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

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 UTC