Blog Stats
  • Posts - 24
  • Articles - 0
  • Comments - 18
  • Trackbacks - 0

 

Wednesday, July 4, 2012

Html 5 – new size units


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.

 

 

Copyright © Norgean