I'm wondering how to ignore a parent style and use the default style (none). I'll show my specific case as an example but I'm pretty sure this is a general question.
<style> #elementId select { height:1em; } </style> <div id="elementId"> <select name="funTimes" style="" size="5"> <option value="test1">fish</option> <option value="test2">eat</option> <option value="test3">cows</option> </select> </div>
Ways I do not want to solve this problem:
For example using firebug i can turn off the parent style and all is well, this is the effect I am going for.
Once a style is set, can it be disabled or must it be overridden?
In CSS, to exclude a particular class, we can use the pseudo-class :not selector also known as negation pseudo-class or not selector. This selector is used to set the style to every element that is not the specified by given selector. Since it is used to prevent a specific items from list of selected items.
To override the CSS properties of a class using another class, we can use the ! important directive. In CSS, ! important means “this is important”, and the property:value pair that has this directive is always applied even if the other element has higher specificity.
You could turn it off by overriding it like this:
height:auto !important;
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