Reputation: 44501
I want to style this element:
<input class="myslider" type="range" value="20">
This is working:
input[class*="myslider"] {
-webkit-appearance: none;
width: 100px;
background-color: black;
height: 2px;
}
But this is not working:
.myslider input[type=range] {
-webkit-appearance: none;
width: 100px;
background-color: black;
height: 2px;
}
Why can't I apply a class selector and an attribute selector?
Upvotes: 0
Views: 131
Reputation: 20293
Becuase you are selecting input inside .mySlider
. Try this:
.myslider[type='range'] {
-webkit-appearance: none;
width: 100px;
background-color: black;
height: 2px;
}
Upvotes: 2
Reputation: 25321
The selector you're looking for is
input.myslider[type=range]
Your current code looks for children elements and doesn't target the appropriate element.
Upvotes: 3