Search Engine Optimization > Web Design > Css inheritance
Css inheritance
Posted by Santi on November 15th, 2004

Can I inherit with css?

for example I have several divs wich have several attributes in common, do I
have to repeat them in each css tag or can I declare one common and then
derive otrers from it?

..tag1{ font-size: 10px; color: #999999; }
..tag2{ font-size: 10px; color: #999999; text-indent: 15; }

what I would like to do is something like:

..tag2{ .tag1, text-indent: 15; }

I know this won't work, but some way to achieve the same

¿or maybe something like to apply several css tags to an element, for ex:
<div class="tag1, tag2, ..." >

regards,
Santi


Posted by Adrienne on November 16th, 2004

Gazing into my crystal ball I observed "Santi"
<nospampleasescorredoira@gmail.com> writing in
news:cnal6h$2ih$1@nsnmpen3-gest.nuria.telefonica-data.net:

<tongue in cheek>You won't get much, but you can try!</tongue>

Yes, CSS is all about inheritance.

For example:

h1, h2, h3, h4, h5, h6 {
text-align:center; border-bottom: 1px dashed #000; font-style: italic;
color: red; background-color: #fff;
}
h1 {
font-size: 150%
}
h2 {
font-size: 140%
}
.... etc.

You would do well to read about inheritance from
[URI:http://www.w3.org/TR/REC-CSS2/cascade.html].

<snip stuff that's almost there>

HTH, and have fun!

--
Adrienne Boswell
Please respond to the group so others can share

Posted by Santi on November 16th, 2004

thanks!

"Adrienne" <arbpen2003@sbcglobal.net> escribió en el mensaje
news:Xns95A2BB8BAD7CEarbpenyahoocom@207.115.63.158 ...


Funbolt.com - Entertainment portal, wallpapers, sexy celebs