I've been struggling with this issue for almost 48 hours now and I haven't been able to find the right assistance to solve my problem. Hopefully, you can provide some guidance :)
There is a main div with the ID "myDiv" and a stylesheet that has specific properties overriding the input elements. However, there are times when I want certain inputs to not adopt the styles specified in the stylesheet.
In the example below, input1 should follow the CSS specifications, while I would like input2 and input3 to have no styling applied. Ideally, they should each have their own unique styling.
Just bear in mind that this is a small excerpt from a larger stylesheet =)
Example:
<div id="myDiv">
<input id="input1" />
<div class="Picker">
<input id="input2" />
<div>
<input id="input3" />
</div>
</div>
... Other html markup
</div>
Stylesheet:
#myDiv input {
width: 40%;
border: 1px solid #c4c4c4;
}
I attempted to use the :not pseudo-class (referencing Mozilla documentation), but it didn't work as expected:
#myDiv div:not(.Picker) input {
width: 40%;
border: 1px solid #c4c4c4;
}
I also tried another approach with direct inheritance:
#myDiv div:not(.Picker) > input {
width: 40%;
border: 1px solid #c4c4c4;
}
Thank you all for your assistance. Apologies for any language errors in my message :)
Bobuche