How can I embed a youtube video using variable widths/heights for a dynamic width web page?

Posted by Dan Gayle on Stack Overflow See other posts from Stack Overflow or by Dan Gayle
Published on 2010-06-18T02:00:26Z Indexed on 2010/06/18 2:03 UTC
Read the original article Hit count: 360

Filed under:
|
|
|
|

I want to set a youtube video to 100% width so that it scales appropriately in a dynamic width column on a web page I am designing.

The problem is that the height doesn't behave like the height of an image. Instead of scaling proportionately, it either collapses (if set to "auto" or left blank) or it scales seemingly random if set to a percentage.

How can I get it to remain proportionate while still dynamic?

© Stack Overflow or respective owner

Related posts about css

Related posts about dynamic