0

I have a dropdown select element in which few of the options need to be shown as bold and underline. I have defined some CSS below:

.OptioncBold{ font-weight:bold; text-decoration:underline;}

This is working fine in Firefox, but not in IE8. When I debug it in IE using the developer tools, it even shows the class being added on that particular option along with both the properties. However, when I see the dropdown select element, the option is neither bold nor underlined. I've read many posts related to this, but could not find anything which helped.

Thanks for your time and help.

Anup

  • Can you try adding the style elements directly to the dropdown and let me know if that makes any difference? – James Johnson Aug 09 '11 at 20:37
  • 1
    Form elements (selects in particular) have wildly varying styles that depend not only on the browser implementing them, but also the operating system the client is on. Solutions would be to use a hacky workaround/plugin or to just drop the style idea completely. –  Aug 09 '11 at 20:38
  • Does adding a IE7 compatibility tag to the page make it work? Is there a IE7 compatibility tag already on the page? If so try removing it. – Ali Aug 09 '11 at 20:40
  • 1
    See this question and answer: http://stackoverflow.com/questions/6655625/styling-options-in-bold-in-internet-explorer – tw16 Aug 09 '11 at 21:19
  • @James Johnson: I tried adding the styles directly to the options..this also did not work.. – Anup Dhiran 0 secs ago – Anup Dhiran Aug 09 '11 at 22:46
  • @ Matt McDonald : Unfortunately, I can not drop the idea not to add the styles. This is a business requirement. – Anup Dhiran Aug 09 '11 at 22:48
  • @Ali : I am not aware much about IE7 compatibility tag, can you please help me on that on how to add/remove it, what is it ? – Anup Dhiran Aug 09 '11 at 22:49
  • This tag needs to be first in the `` (before any css): `` having this meta tag in the head will force IE8 to use IE7 compatibility mode. – Ali Aug 09 '11 at 23:12
  • @Ali..even that did not work :( adding or removing it.. – Anup Dhiran Aug 09 '11 at 23:47
  • @tw16 : this helped a lot. I tried the plug in given in the example for that question..it's not working though.I am working on the alternatives..will let everyone know if I am able to find something..Thanks all for your help.. – Anup Dhiran Aug 12 '11 at 02:20

1 Answers1

0

It is not working in ie, you can try a plugin for custom selectboxes.

kuyabiye
  • 700
  • 3
  • 13