Inheritance question

liunx

Guest
In C++ if I want to define a class that inherits all of the attributes of a previously defined class I can simply reference the existing class in the definition and then add the additional properties. Can that be done in CSS?

The following is a pretty simple example of where I needed a special instance of a class in order to apply an IE hack. But if the "cright" were an extensive definition, would there be a way to avoid redefining it?

.cright {
float: right;
text-align: right;
}

* html #crt1 { margin-right: 7px; }
#crt1 {
margin-right: 17px;
float: right;
text-align: right;
}There are better ways to do this:#crt1 {
margin-right: 17px !important;margin-right: 7px;
float: right;
text-align: right;
}
or using conditional comments (<!-- m --><a class="postlink" href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">http://msdn.microsoft.com/workshop/auth ... nt_ovw.asp</a><!-- m -->) where you can target specific versions of IE:

<!-- [if IE 5]>
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"IE.css">
<![endif] -->
 
Back
Top