CSS selector for empty attribute

Oxygen general issues.
honyk
Posts: 176
Joined: Wed Apr 29, 2009 4:55 pm

CSS selector for empty attribute

Post by honyk »

Hello,

I'd like display links without specified target in red. In Docbook there is link element with linkend attribute. I've specified following styles:

Code: Select all

link {
color:red;
}
link[linkend] {
color:navy;
}
But it don't work properly if linkend attribute is present, but empty. In documentation there is not mentioned :empty selector so I do know how to achieve correct behaviour. Thanks in advance for any tip.

Jan
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: CSS selector for empty attribute

Post by sorin_ristache »

Hello,

If the linkend attribute is present and empty the second selector is used, that is the link text is colored with navy. Do you want a different color when linkend attribute is empty? You can use for example:

Code: Select all

link {
color:red;
}


link[linkend] {
color:navy;
}

link[linkend=""] {
color:yellow;
}

Regards,
Sorin
Post Reply