Reputation: 135
Currently I was going through some code over internet and I found this part of the code input[type=text]:not(.browser-default).valid
. In the following code I know what :not is used for. However I have following question:
What does (.browser-default)
part of the code does and where can I find more information about it?
I know what is :valid
but not .valid
? What it does and where can I read its exact functionality?
Upvotes: 1
Views: 1671
Reputation: 12969
.browser-default
and.valid
are class names that programmer defined in his code and thay are not keyword in css.
input[type=text]:not(.browser-default).valid
this selector, selects input if it have the following conditions:
input have :
1) attribute type
with value text
.
2) class valid
And have not :
1) class browser-default
See this example :
input[type=text]:not(.browser-default).valid {
background-color: blue;
}
<input type="text" class="valid">
<br>
<input type="text" class="browser-default valid" name="">
Upvotes: 0
Reputation: 125601
Both .browser-default
and .valid
are user-defined class names. They are not part of the CSS Selectors Module - so you won't find more information about them!
In contrast, :not and :valid are CSS pseudo classes and are defined within the CSS selectors module.
So basically, the selector
input[type=text]:not(.browser-default).valid
matches a text input with a class valid
and without a class browser-default
Upvotes: 3