My code:
body {
font-family:"Verdana",Arial,Helvetica,sans-serif;
}
.myfont {
font-family:"Verdana",Arial,Helvetica,sans-serif;
}
<body>
Hello
<select>
<option>
Hello
</option>
</select>
<select class="myfont">
<option>
Hello
</option>
</select>
</body>
Why is the first <select>
element not inheriting the font-family
property from the specification for <body>
?
If I have to change the font for a <select>
why do I have to copy the style?
If you use:
select {
font-family: inherit;
}
It'll work fine. CSS is a little quirky when it comes to form controls.
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