Vererbungslehre, 3 Generationen
Kalle
- css
0 nag
Hallöle, ich hätt' da gern mal ein Problem ...
Wenn ich schreibe
<p class='rand'>...</p>
Dann hat ja dieser Absatz alle Eigenschaften von
p { font-family:comic sans ms; ... }
aber auch die von
p.rand { border:1px solid #f00; ... }
Nun möchte ich alle Eigenschften von p.rand, ABER ZUSÄTZLICH mit einer Hintergrundfarbe:
p.rand.gelb { background-color:#ffa }
Und genau das funzt nicht:
<p class='rand.gelb'>...</p>
<p.rand class='gelb'>...</p>
<p class='rand' class='gelb'>...</p>
Wie kann ich in der Vererbung eine DRITTE GENERATION definieren ?
Fragt Kalle aus Worms
Hallo,
Und genau das funzt nicht:
<p class='rand.gelb'>...</p>
<p.rand class='gelb'>...</p>
<p class='rand' class='gelb'>...</p>
besser:
<p class="rand gelb">...</p>
http://www.edition-w3c.de/TR/1998/REC-CSS2-19980512/kap05.html#heading-5
ich verabscheu mich ;)
NAG
Hallo,
Und genau das funzt nicht:
<p class='rand.gelb'>...</p>
<p.rand class='gelb'>...</p>
<p class='rand' class='gelb'>...</p>besser:
<p class="rand gelb">...</p>
Danke, da hatte ich also den Punkt zuviel.
der link war nicht ganz
zweckbezogen
http://edition-w3.de/TR/1999/REC-html401-19991224/struct/global.html#adef-class
was besseres hab ich im moment nicht gefunden.
mfg NAG