Jump to content

Real-world CSS Units


Recommended Posts



...really ought to mention that according to http://www.w3.org/TR/CSS2/syndata.html#length-units the inch, millimeter and centimeter units are only going to work as you'd expect on desktop devices. On mobile platforms, the spec says that the browser should consider the typical viewing distance of these devices (ie much closer than a desktop display) and scale the display accordingly. Since there is no standard for what that typical viewing distance might be - device and browser manufacturers are at liberty to pick just about any number they feel like...so all bets are off.


So even though you go to all the trouble to say "I WANT THIS TO BE TWO INCHES WIDE!!!" - you'll basically be ignored.


Using all of the non-standard <meta> stuff to turn off zooming and to prevent the user from manually zooming - you still get results that are between maybe a half and a third of the size you asked for.


Basically, these units are useless.




-- Steve


Link to comment
Share on other sites

I believe their main purpose was to be used for documents that are going to be printed. When I tested units on my screen I noticed that a centimeter in CSS is actually 9 millimeters on my screen.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...