W3C home > Mailing lists > Public > www-style@w3.org > May 2008

Re: [CSS 21] overflow:hidden adjacent to a float

From: Alan Gresley <alan@css-class.com>
Date: Tue, 20 May 2008 23:43:28 +1000
Message-ID: <4832D580.2090804@css-class.com>
To: Alan Gresley <alan@css-class.com>
CC: David Woolley <forums@david-woolley.me.uk>, "www-style@w3.org" <www-style@w3.org>

Alan Gresley wrote:

> If an author chooses to have a base layout such as:
> 
> 
> <div style="float:left">
>     <div style="float: left">
>     <div style="overflow: hidden; margin-left: 200px">
>         <div style="float:left">
>         <div> .... </div>
>     </div>
> </div>


And I thought I had checked that properly. Again the code:

<div style="float: left">
	<div style="float: left">
	<div style="overflow: hidden; margin-left: 200px">
		<div style="float: left"> ..1st.. </div>
		<div> ..2nd.. </div>
	</div>
</div>


Apart from the inner float (1st) be contained by it's parent with 
overflow:hidden which establishes a new block formatting context, this 
code also allow authors to stops the vertical margins collapsing for the 
first and last in-flow child block elements in the static in-flow div 
(2nd). It also possible to remove all the bottom margins of all the 
floats to have content rising behind the floats. There are many possibles.

Very cool code indeed but a super CSS bug creator.


Alan

http://css-class.com/test/
Received on Tuesday, 20 May 2008 13:44:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:06 GMT