[dokuwiki] Re: syntax hilighting

Galen Johnson wrote:
.code .kw2    (line 8)
{
    color: rgb(0, 0, 0);
    font-weight: bold;
}

.code.sas .kw2    (line 29)
{
    color: rgb(0, 0, 255);
}

Isn't there some way to make only the appropriate class take
affect...what I'm seeing now is the correct color but it is retaining
the font attributes from the previous definition.  Shouldn't the
.code.sas be the dominant tag not the cruft from the others?

=G=
The "C" in CSS means cascade. All rules are applied in a cascade, specificity is used to resolve conflicts when more than rule affects the same property. The more specific selector dominating the less specific. When specificity is identical, the last encountered rule apples.

so in your above snippet.

".code.sas .kw2" is more specific than ".code .kw2" and as such its color is the used colour. However it says nothing about the font-weight, so the font-weight is set using the value given ".code .kw2".

In well behaved browsers, the default styling you see comes from a browser stylesheet. Its applied first and with the lowest (only tag & pseudo element, pseudo class selectors) specificity.

Cheers,

Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: