Re: Why is there != attribute selector in CSS?

Agreed. It makes sense. Seems unnecessarily redundant.

Because :not() can accept elements, id's, or classes. So there's not much
that it's lacking.

Also while '!' is primarily used and known as not/opposite in programming,
in CSS it means the opposite.
For instance in overriding superior styles, !important does not mean not
important, but the most important.

Therefore, the '!' notation must not be introduced or used in CSS, to mean
not/opposite, as it already has its own meaning.

Regards,
Irfan
On Oct 12, 2011 10:39 AM, "Tantek Çelik" <tantek@cs.stanford.edu> wrote:

> On Wed, Oct 12, 2011 at 09:42, Fred . <eldmannen@gmail.com> wrote:
> > Why is there != (negative) attribute selector in CSS?
> > Such as:
> > option[value!="Foo_"] or ~^="Foo_"
> >
> > Is there any way I can select anything except option[value^="Foo_"] ?
>
> :not can be used for this:
>
> option:not([value="Foo_"])
>
> -t
>
> --
> http://tantek.com/ - I made an HTML5 tutorial! http://tantek.com/html5
>
>

Received on Wednesday, 12 October 2011 15:55:09 UTC