Page 1 of 1

CSS selector for empty attribute

Posted: Tue Aug 25, 2009 10:29 am
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

Re: CSS selector for empty attribute

Posted: Tue Aug 25, 2009 3:59 pm
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