Pertaining to vh, vw, vm

I noticed these while browsing through the CSS3 proposed specifications. 
While I will be ecstatic if this unit makes it into the final 
specification, I feel it could be better implemented. Instead of each 
unit being relative to the viewport's dimensions, why can't these be 
relative to the selected element's own dimensions? It would be MUCH more 
useful that way. the <html> element could be assumed as equal to the 
viewport by default but it would allow the designer to override settings 
on an elemental basis without worrying about the relative aspect of its 
parent objects.

For example (I've eliminated many necessary tags for the sake of brevity):
<body>
    <div id="banner">
        <p>This is section I</p>
    <div>
    <div id="interface">
        <p>This is section II</p>
        <ul>
           <li>Menu Item</li>
        </ul>
    </div>
    <div id="content">
       <div id="productView">
          <p>Buy xxx product today!</p>
       </div>
       <div id="main">
          <h1>Site News</h1>
       </div>
    </div>
    <div id="copyright">
       <p>All content copyright our company</p>
    </div>
</body>

In this example, perhaps the designer would like the whole page to take 
up 75% of the viewport's width and 100% of its height. Thus, you would 
leave the <html> tag's height alone as the default is 100 units but you 
would reduce its width to 75 units (we're assuming no background image 
will be used for the remaining 25%). now, assume that the 'productView' 
section is supposed to be equal to 1/3 of the banner's height and width. 
Well, the height works as it should by specifying 33.33 (or however many 
precision units are allowed) units but the height must be specified as 
25 units instead of the 33.33 units as you'd expect. This is contrary to 
the behavior of the em unit of measurement and having a consistent logic 
applied to your units of measurement will help the adoption of the new 
styles.

As I said, I'm just happy that we may *finally* have a method of 
controlling aspect ratios that doesn't rely on JS, but it would be much 
more acceptable if it worked in the same manner as the other relative 
unit types.

-- 
Thanks,

Jim

Received on Tuesday, 23 October 2007 12:42:29 UTC