This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22474 - Percentage top and bottom property does not always refer to the height of containing block
Summary: Percentage top and bottom property does not always refer to the height of con...
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: CSS Level 2 (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Bert Bos
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-26 13:10 UTC by Glen Huang
Modified: 2013-06-26 13:10 UTC (History)
0 users

See Also:


Attachments

Description Glen Huang 2013-06-26 13:10:05 UTC
From http://www.w3.org/TR/CSS21/visuren.html#position-props
the spec says:

> <percentage>
>         The offset is a percentage of the containing block's width (for 'left' or 'right') or height (for 'top' and 'bottom').

But test case http://jsbin.com/ocadip/18/edit show that for all major browsers, when a relatively positioned box is inside an absolutely positioned box, it's percentage top property resolves to zero.

From the discussion at http://lists.w3.org/Archives/Public/www-style/2013Jun/0473.html it appears that if a relatively positioned box's containing block doesn't have an explicitly specified height value the top and bottom property of that relatively positioned box, if they are of a percentage value, should compute to zero, which works much like the height property.

So I think the spec should at least mention that.