For example I have a css style like this :
input.validation-passed {border: 1px solid #00CC00; color : #000;}
The javascript validation framework I use will inject every input tag with a class="validation-passed" .For the elements like <input type='text' />
... , this is ok , but for <input type='button' />
, I want this is not applied , how should I do this ?
If you want to exclude root elements like html / body , you could select all elements within them. To exclude other elements, you could use the :not() pseudo-class to negate them. For instance, you could add an . excluded class to the elements.
Press TAB to highlight the element, and then click to select it. In the drawing area, click the icon ( ) to exclude the element, or right-click, and click Exclude. The element is excluded from the group instance, and hosted elements are rehosted as necessary.
To select all the children of an element except the last child, use :not and :last-child pseudo classes. Example 1: This example creates a navigation menu separated by right border except the last element. Example 2: This example creates a navigation menu and uses some CSS property except the last element.
Wildcard Selectors (*, ^ and $) in CSS for classesWildcard selector is used to select multiple elements simultaneously. It selects similar type of class name or attribute and use CSS property. * wildcard also known as containing wildcard.
.validation-passed:not(input[type="button"]) {color:red;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With