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 15774 - Over-simplification in description of how clearance acts as spacing above top margin
Summary: Over-simplification in description of how clearance acts as spacing above top...
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: CSS Level 2 (show other bugs)
Version: unspecified
Hardware: All Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Bert Bos
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-29 17:55 UTC by Anton P
Modified: 2012-12-04 00:54 UTC (History)
0 users

See Also:


Attachments

Description Anton P 2012-01-29 17:55:35 UTC
Reported by Anton Prowse

9.5.2 ('clear') says:

  # Clearance inhibits margin collapsing and acts as spacing above
  # the margin-top of an element. It is used to push the element
  # vertically past the float.

The problem is that the top margin edge of an element is not defined in CSS when that margin participates in margin collapsing.  (See Bug 15748.)

Consider the following example:

<div style="clear:both; margin-top:0">
	<p style="margin-top:20px">text</p>
</div>

In the presence of floats, clearance is introduced as spacing above the
div, specifically at 20px above the div's top border edge (at the top of the collapsed margin lump), not 0px above the div's top border edge (which is where one might naively claim its top margin edge to be).

If we do not define the position of the top margin edge, we need to rewrite the description of how clearance acts.


Bug description: http://lists.w3.org/Archives/Public/www-style/2010Aug/0259.html (last part)