Cross-browser issue for highlighting an option element in bold in a select form element,

I ran into one weird cross-browser problem. ie I want to highlight some option elements in bold using the CSS class in the "select" form element. All this works fine only in firefox, but not in other browsers like safari, chrome and IE. Below is the code.

<html>
 <head>
  <title>MAke Heading Bold</title>

  <style type="text/css">

  .mycss {font-weight:bold;}

  </style>

 </head>

 <body>

  <form name="myform">

   <select name="myselect">

    <option value="one">one</option>
    <option value="two" class="mycss">two</option>
    <option value="three" >Three </option>
   </select>

  </form>
 </body>
</html>
+3
source share
1 answer

Vivec will try it

<style type="text/css">
   option.mycss{font-weight:bold;}
</style>

For reference Splitting layout lists

0
source

Source: https://habr.com/ru/post/1742963/


All Articles