Html 5 – new size units

Posted by Norgean on Geeks with Blogs See other posts from Geeks with Blogs or by Norgean
Published on Wed, 04 Jul 2012 20:50:55 GMT Indexed on 2012/07/04 21:16 UTC
Read the original article Hit count: 194

Filed under:

There are some new size units with CSS 3, which allows you to resize elements relative to the viewport size. They are vw, vh, vmin (that’s vm in IE), and perhaps vmax. (Viewport width, height, smaller of the two, larger of the two.)

8vw is 8% of the viewport width – or 205 pixels on my 2560 screen.

I created a tiny demo clock which sizes the elements so that it uses the whole screen.

Clock – in Norwegian, but it’s the source that is interesting…

Bug: Resize does not work.

Tested for IE 9 & 10 and Chrome. Firefox and Safari: does not work.

© Geeks with Blogs or respective owner