Select dropdown option bold in chrome

16,858

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/

Share:
16,858
Khang Bùi
Author by

Khang Bùi

Updated on June 14, 2022

Comments

  • Khang Bùi
    Khang Bùi almost 2 years

    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.

  • Khang Bùi
    Khang Bùi almost 12 years
    Is there any way to do it with javascript??
  • AlignedDev
    AlignedDev over 8 years
    This did not have any effect on the option for me in Chrome.