This question already has answers here:
Closed 4 years ago.
Is there any way to make an <option>
tag bold in a select
box in Chrome and IE using CSS? It's working in Firefox.
option.red {
background-color: #cc0000;
font-weight: bold;
font-size: 12px;
color: white;
}
<select name="color">
<option class="red" value="red">Red</option>
<option value="white">White</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
This is the same question as here, but there was no answer.
You cannot do this. The most likely solution you'll find "out there" would be to add a surrounding span with hard coded style, but neither IE (7) nor Firefox (3.0.12) honor this.
What you can do is use a JavaScript solution to give you the appearance of a select without actually using a select.
And here's a great "howto" on how to do it: http://www.devirtuoso.com/2009/08/styling-drop-down-boxes-with-jquery/
I used <option class="bold">Bold Text here</option>
with CSS:
option.bold {
font-weight:bold;
}
and it worked for Firefox (Mac and Windows) and for IE11, but not for Chrome or Safari.
Since Chrome doesn't allow bold font on option tag, you can use text-shadow
property like
text-shadow: 0px 0px 0px black;
It will give same appearance of bold and work on all the browsers.