[dokuwiki] Re: syntax hilighting

Chris Smith wrote:

> 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


Thanks Chris....a bit more research showed that...however, I haven't had
much success in forcing the font to be reset...are you aware of a
standard way to accomplish this...'!important' and 'font: normal'
doesn't work...I was hoping to be able to do something like {color:
#000000; font: normal;} but that didn't seem to want to work.  I'm still
digging but if you know of a way, it'd help.

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

Other related posts: