W3C home > Mailing lists > Public > www-style@w3.org > October 2010

Re: [CSS21] 9.5.1: placing floats above earlier blocks & line boxes

From: Peter Moulder <peter.moulder@monash.edu>
Date: Fri, 15 Oct 2010 13:36:28 +1100
To: www-style@w3.org
Message-id: <20101015023628.GA20254@bowman.infotech.monash.edu.au>
I believe the initial example was correct and did use what Anton describes as
a wrapper box to have the negative margin.  I'd guess that the problem was just
that there wasn't enough whitespace to notice.  (And the fact that it would be
easy to forget to use a wrapper box for the negative margin.)

Here it is again but with a bit more whitespace to show the wrapper
relationship more clearly, and with div's throughout instead of p/span.
And let's add a stylesheet for some colour, following Alan Gresley's lead.

  <title>Rules 5 &amp; 6</title>
  <style type="text/css" media="all">
  div { background:silver; color:maroon; }
  div div { background:yellow; color:green; }
  <div>An earlier block and line box</div>
  <div style="margin-top: -3.5em;">
    <div style="float:left;">A float.</div>

Received on Friday, 15 October 2010 02:37:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:39 UTC