>>  I'd appreciate any comment that would help me improve this article:
>>  
>>
<http://tjkdesign.com/articles/clearing-floats_and_block-formatting_context.
asp>
>>  
>>  The demo:
>>  
>>  <http://tjkdesign.com/articles/block-formatting_context/newBFC.asp>
>
> Hi Thierry, I hope your not advocating the use of invalid CSS.
>
> "Setting hasLayout in IE 7"
>
> .newBFC {
> overflow: hidden;
> _overflow: visible;
> _overflow-x:hidden;
> _height: 0;
> *min-height: 0;
> }
>
> The last line is not needed to set hasLayout in IE7 as overflow:hidden
already does this. 

Very good catch!

When I started writing this article I was using this:

selector{overflow:hidden;*overflow:visible;
*overflow-x:hidden;_height:0;*min-height:0;}

but going from "*" to "_" removes the need for "min-height" 

> The universal selector and the underscore is invalid CSS. 
>
> For the good browsers you can have.
>
> .newBFC {overflow: hidden;}
>
> For IE6 and earlier (hidden from IE mac)
>
> /*  \*/
> * html .newBFC {
> overflow: visible;
> overflow-x:hidden;
> height: 0;
> }
> /*  */
>
> For IE mac (hidden from other browsers)
>
> /*\*//*/ 
> .newBFC {display: inline-block;}
> /*  */

> Having such ugly hacks keeps people aware that sooner or later they can
remove these hacks from their CSS as these legacy browsers fade away.

I used to think that way, I used to use Conditional Comment to serve just 1
or 2 rules to IE. Now I think keeping things "compact" - *in one place* - is
the best approach (at least it is for me). The above is extra bytes and
create one extra rule. I never cared for CSS validation.

Thanks for the heads up :)


-- 
Regards,
Thierry | http://www.TJKDesign.com


    

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to