Author CSS "not" operator?

Oxygen general issues.
maglid
Posts: 75
Joined: Mon Sep 28, 2009 8:10 am

Author CSS "not" operator?

Post by maglid »

I want to stop the display in Author mode of an element that does NOT have a certain attribute. I was hoping for something like this but I can't find it in the help:

Code: Select all

/* do not display <myElement myAttribute="..."  */
myElement:not(myAttribute) {
display:none;
}
Is there a negation function like this available?

Thanks,
Mark
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author CSS "not" operator?

Post by Radu »

Hi Mark,

There is no CSS rule to state that an element without a certain attribute should be matched.
But:
There is a CSS rule which states that an element which has a certain attribute should be matched. So if for instance you have the following CSS:

Code: Select all


myElement{
display:inline;
}

myElement[myAttribute]{
display:block;
}
Then for the display property the first selector will be used when the attribute is not found on the element. And the second selector will be used when the attribute is found on the element (because it is more specific).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply