Posted by jb on 03/10/06 00:53
> 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.
>
It seems like a glaring omission.
[Back to original message]
|