W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: [CSS21] Floating - who's right?

From: Alan Gresley <alan@css-class.com>
Date: Sat, 05 Feb 2011 18:35:06 +1100
Message-ID: <4D4CFDAA.10206@css-class.com>
To: Васил Рангелов <boen.robot@gmail.com>
CC: www-style@w3.org
On 5/02/2011 11:22 AM, Васил Рангелов wrote:
> Hello CSSWG.
>
> I recently found something resembling a bug related to floats... but
> the thing is two implementations do it one way, and two others do it
> another way, so I don't know who's right and who's not. I hope that
> if I bring the issue here, implementers would be able to resolve
> who's to fix what.
>
> The problem is that a relatively positioned box with a clear inside
> it turns out on top of a statically positioned left floated box
> preceding it.

Boriz and Fantasai has given good reason why the link is un-click-able 
which is correct.

What I find remarkable is that having clear on a empty element actually 
generates a block in the first place. The only thing that position 
relative does is changes the stacking layer

Васил, try this which should show the differences.

<!DOCTYPE html>

<style type="text/css">
   .floated { float:left; background:lime;}
   .positioned { position:relative; background: rgba(255,0,0,0.3); }
   .cleared { clear:left; background: rgba(0,0,255,0.3); }
</style>

<div class="floated">
   <a href="#">click me if you can</a>
</div>
<div class="positioned">
   <div class="cleared"></div>
</div>

<div class="floated">
   <a href="#">click me if you can</a>
</div>
<div class="positioned">
   <div class="cleared"> give me a box </div>
</div>

<div class="floated">
   <a href="#">click me if you can</a>
</div>
<div class="positioned"> give me a box </div>

<div class="floated">
   <a href="#">click me if you can</a>
</div>
<div class="positioned"></div>




-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Saturday, 5 February 2011 07:35:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:37 GMT