[dokuwiki] Re: syntax hilighting
- From: Chris Smith <chris@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Fri, 30 Dec 2005 09:29:13 +0000
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
- Follow-Ups:
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- References:
- [dokuwiki] syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Chris Smith
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Chris Smith
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Chris Smith
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
Other related posts:
- » [dokuwiki] syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
- » [dokuwiki] Re: syntax hilighting
.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=
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Chris Smith
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Chris Smith
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Chris Smith
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson
- [dokuwiki] Re: syntax hilighting
- From: Galen Johnson