Posted by Toby Inkster on 03/09/06 22:32
jb wrote:
> Can another style be created which inherits border_color in its entirety?
Nope -- not the way you mean. CSS inheritance works differently from
object-oriented inheritance.
If you want to reuse colours and other styles over several different
classes, you might want to look into using a server-side scripting
language to serve your CSS.
e.g.
<?php
header("Content-Type: text/css");
$headingHighlight = '#ccffcc';
$normalForeground = '#006600';
?>
H1 {
border-left: 0.67em solid <?=$headingHighlight?>;
border-bottom: 2px solid <?=$headingHighlight?>;
padding: 0.25em;
}
H2 {
background: <?=$headingHighlight?>;
color: <?=$normalForeground?>;
padding: 0.25em;
}
and so on.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
[Back to original message]
|