question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Percentage values for width and height are not set correctly

See original GitHub issue

Expected Behavior

Passing in width and height options as 100% should set the iframe width and height attributes to 100%

Actual Behavior

The iframe width and height attributes are set to just 100, which is interpreted by browsers as 100px

Steps to Reproduce

new Vimeo.Player(90509568, {
  width: '100%',
  height: '100%'
})

Produces something like the following:

<iframe src="https://player.vimeo.com/video/90509568" width="100" height="100"></iframe>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:13
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
cookpetecommented, Feb 27, 2018

@rsichel107 why has this been closed? It’s an old issue but still a problem as far I can see. The ideas posted (setting iframe height and width after the fact) seem like workarounds and not an actual solution.

4reactions
ahmadawaiscommented, Jul 6, 2018

OK That’s not a problem for me coz all my videos are of the same aspect ratio and size.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are the consequences of using percentage for width ...
It says that the width attribute must be set in pixels not in percent. But solving my problem was far more easier when...
Read more >
<percentage> - CSS: Cascading Style Sheets - MDN Web Docs
The <percentage> CSS data type represents a percentage value. It is often used to define a size as relative to an element's parent...
Read more >
Percentage of width not working - support - HUGO
I want to use the percentage of width to make the image responsive just like the screenshot did.(this was changed in the inspect...
Read more >
width | CSS-Tricks
If your parent is set at 480px – as demonstrated by our demo – then the percentage is based on that value. So...
Read more >
CSS Height, Width and Max-width - W3Schools
% - Defines the height/width in percent of the containing block; initial - Sets the height/width to its default value; inherit - The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found