jbokkers
jbokkers

Reputation: 972

Internet Explorer 9 beta HTML5 video tag not supporting relative width/height?

Is it correct that IE9 (Beta & Preview) don't support relative width/height on the html5 video tag?

Chrome, Safari & Firefox all nicely accept a width=50%, but IE9 seems to read it as 50px. (Video is showing in all 4 browsers so no problem there).

I was wondering if it's a bug/feature yet to be implemented or permanent solution.

J.

Upvotes: 5

Views: 4246

Answers (3)

Spudley
Spudley

Reputation: 168685

Have you tried setting the height and width using CSS rather than the HTML element's attributes?

ie rather than:

<video src='whatever' height='50%' width='50%'>

you could try:

<video src='whatever' style='height:50%; width:50%;'>

...or, of course, put the styles into your separate CSS file.

Upvotes: 4

dudeman
dudeman

Reputation: 11

I used CSS to style the tag for width:100% and height:100%. I tried IE9 Beta and that seemed to work.

Upvotes: 1

jbokkers
jbokkers

Reputation: 972

I just installed the IE9 Release Candidate and since there's no change I guess we can call this their permanent solution.

Just to be complete: <video width="100%" height="100%"></video>

Will render as 100px width in IE9. In latest versions of Chrome, FireFox, Safari and Opera this will be rendered 100% width of the parent div.

Upvotes: 2

Related Questions