"Luke" <lu**********@ihsti.com> wrote in message
news:7e*************************@posting.google.co m...
Hi,
Is it possible to do this...
.MyStyle{
color: White;
font-family: Verdana;
font-size: 10px;
background-color: Blue;
}
.MyNewStyle{
INHERIT ALL THE STUFF FROM MyStyle
background-color: Red; /* OVERRIDE THE BGCOLOR*/
}
So, what I mean is, can I inherit and override certain properties from
another style. This will save me repeating the same style just to
change one property.
No, CSS doesn't provide that. What you CAN do is:
..MyStyle{
color: White;
font-family: Verdana;
font-size: 10px;
background-color: Blue;
}
..MyNewStyle{
background-color: Red;
}
and later
<div class="MyStyle MyNewStyle">...
with the class names separate by white space. Netscape 4.x won't recognize
this, and I don't know which version of IE first accepted it but IE6
understands it, as do the more advanced browsers.