htmlcsshtml-selectoptgroup

How can I let the disable option being bold and black at select html?


The system default selects the "Please Select" option and it is disable to select. Now the option is gray. Can I bold it and let the color is black?

Thank you.

 <select id="commentType" name="commentType" required="true" >
        
                                            <option value="Please Select" disabled selected>Please Select</option>
                                            <option value="Bonus Point">Bonus Point</option>
                                            <option value="Car Park">Car Park</option>
                                            <option value="Gift">Gift</option>
                                            <option value="Promotion">Promotion</option>
                                            <option value="Technical Support">Technical Support</option>
                                            <option value="Others">Others</option>
        
    </select>

enter image description here


Solution

  • try this..

    <select id="commentType" name="commentType" required="true">
    
      <option value="Please Select" disabled selected style="font-weight:bold;color:black">Please Select</option>
      <option value="Bonus Point">Bonus Point</option>
      <option value="Car Park">Car Park</option>
      <option value="Gift">Gift</option>
      <option value="Promotion">Promotion</option>
      <option value="Technical Support">Technical Support</option>
      <option value="Others">Others</option>
    
    </select>