On 5/4/07, Glen Lipka <[EMAIL PROTECTED]> wrote:

div.foo.bar {} works perfectly in IE6, IE7, and FF.
Holy Cow!  Basic regular CSS.  How did I not know this?  How have I gone
so long and not known this?
This is HUGE.  I have spent so many hours working around this problem.  My
god.  I am doofus!


Any browser worth caring about anymore, and even some of the earlier IE
versions handle multiple classes with no trouble at all. Now that you know,
it's probably going to become one of your favorite tricks. It becomes really
handy for things like blogs that have images positioned left, right, center
with shared styles(like borders), but sometimes the authors need to be able
to cancel out the borders. A standard set of rules for me when building a
site is:

img {basic border/background styling}
img.left {float left, direction-specific margins}
img.center {display as block, top/bottom margins}
img.right {float right, direction-specific margins}
img.noborder {border:none;}

And then the authors just use them as a modular set:
<img class="left noborder" .... />

Reply via email to