style sheets

Unknown W. Brackets unknown at simplemachines.org
Sun Jun 4 14:54:27 PDT 2006


CSS hacks are evil.  They are worse than the C++ preprocessor because 
they are undocumented.

In fact, they are bugs that should and most often are fixed in later 
versions.  For example, IE7 fixes many CSS bugs resulting in many of 
these sorts of hacks no longer working.

Please do not use CSS hacks.

-[Unknown]


> In article <e5vgbg$2efc$1 at digitaldaemon.com>, Walter Bright says...
>> I took out the:
>>
>> 	height=0;
>>
>> lines in www.digitalmars.com/d/style.css, so it works in mozilla, but 
>> now it doesn't look right in Explorer (excessive vertical spacing).
>> Also, the tabs on the upper right are one pixel too low in mozilla.
>>
>> Anyone know how to write a style sheet that will work in both?
> 
> Rather convinently, IE will still process any rule that begins with '//'.  As
> all browsers will follow the last declared instance of a rule, you can exploit
> both behaviors like so:
> 
> foobar{
> height: 1px;
> //height: 0px;
> }
> 
> .. where Mozilla will obey the comment and use 1px, and IE will follow both and
> use 0px due to the ordering.
> 
> While I don't advocate using stylesheet hacks like that, sometimes, its the
> fastest workaround available.
> 
> - EricAnderton at yahoo



More information about the Digitalmars-d-announce mailing list