style sheets

pragma pragma_member at pathlink.com
Sun Jun 4 13:48:15 PDT 2006


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