Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS using multiple :not selectors not working

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #43193
    keeganl
    Member

    I am wondering how to do multiple :not selectors in my css.

    For example:

    textarea, input:not([type=button]), input:not([type=submit]), input:not([type=number]) { color: red;}

    All of my input’s will be colored red, but when I do

    textarea, input:not([type=button]) {color:red;}

    then the input type button will not be red, just like I wanted.

    Will I just have to create two separate styles with the same properties?

    #127219
    Merri
    Participant

    Probably needs you to think differently:

    input:not([type=button]):not([type=submit]):not([type=number])

    Didn’t test and I haven’t used :not like this, but initial thoughts tell me this might be the answer.

    #127228
    keeganl
    Member

    Thanks Merri it worked perfectly.

    #132128
    diccfish
    Member

    Brilliant! Just what i needed :)

    #132136
    Kitty Giraudel
    Participant

    > input:not([type=button]):not([type=submit]):not([type=number])

    This is going to be slow. :)

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.