Abdelouahab Pp
Abdelouahab Pp

Reputation: 4440

how to exclude an element using CSS3?

Here is the code:

input:not(#radioo input){
    display: block; 
    font-size:23px;
    border-radius: 10px; 
    width:310px;
    height: 40px
}

but all input are excluded! and I want only to exclude input that is in the form that has the ID radioo

Upvotes: 1

Views: 118

Answers (2)

Musa
Musa

Reputation: 97672

:not only takes simple selectors the best solution would be to give each input you want to exclude a class and use :not(.theclass)

From the comments it seems there is a solution without adding a class

form:not(#radioo) input{
    display: block; 
    font-size:23px;
    border-radius: 10px; 
    width:310px;
    height: 40px
}

Upvotes: 3

cimmanon
cimmanon

Reputation: 68319

The following selector seems to do what you want. Only the input in the second form will have an orange background.

http://jsfiddle.net/pYhgr/

form:not(#radioo) input {
    background: orange;
}

<form id="radioo">
    <input type="text" />
</form>

<form>
    <input type="text" />
</form>

Upvotes: 2

Related Questions