Welcome to TalkGraphics.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2000
    Location
    Austria
    Posts
    1,081

    Default

    Hi,

    I try and I try, but I can't find a way to do this.

    I have a simple dropdown-box like this one:

    <SELECT NAME="dropdown" style="font-family: Verdana; font-size: 10pt">
    <OPTION VALUE="">Choose an option: </OPTION>
    <OPTION VALUE="">First option</OPTION>
    <OPTION VALUE="">Second option</OPTION>
    <OPTION VALUE="">Third option</OPTION>
    </SELECT>

    and I want to highlight a single option like making it bold or a different color.

    I can put a 'style' option inside the 'SELECT' tag, but that affects ALL options.
    what if I only want to make 'Second option' bold or colored ?

    Putting any formatting inside the 'OPTION' tags does not seem to have any effect at all.

    Anybody knows if this is possible ??
    How ??

    Wolfgang
    IP

  2. #2
    Join Date
    Aug 2000
    Location
    Austria
    Posts
    1,081

    Default

    Hi,

    I try and I try, but I can't find a way to do this.

    I have a simple dropdown-box like this one:

    <SELECT NAME="dropdown" style="font-family: Verdana; font-size: 10pt">
    <OPTION VALUE="">Choose an option: </OPTION>
    <OPTION VALUE="">First option</OPTION>
    <OPTION VALUE="">Second option</OPTION>
    <OPTION VALUE="">Third option</OPTION>
    </SELECT>

    and I want to highlight a single option like making it bold or a different color.

    I can put a 'style' option inside the 'SELECT' tag, but that affects ALL options.
    what if I only want to make 'Second option' bold or colored ?

    Putting any formatting inside the 'OPTION' tags does not seem to have any effect at all.

    Anybody knows if this is possible ??
    How ??

    Wolfgang
    IP

  3. #3
    Join Date
    Aug 2000
    Location
    Las Vegas, NV
    Posts
    819

    Default

    Wolfgang,

    You need to put a Style option within the option tag ... but you must close the tag.
    <select name="people">
    <option value="0" selected>None
    <option value="1-5" style="color: Fuchsia; font-size: small;">1-5</option>
    <OPTION VALUE="6-15">6-15
    <OPTION VALUE="15+">15+
    </SELECT>

    Here's the code:
    I hope this works, I've never posted code before.

    Mickie
    IP

  4. #4
    Join Date
    Aug 2000
    Location
    Austria
    Posts
    1,081

    Default

    Hi Mickie,

    this helps a lot, so I know SOMETHING can be done. I always had my option-tags closed, but I never tried colors.
    Instead I desperately tried to make one or more entries bold.

    I still can't do it.
    While your code works perfectly and I can make the entries all the colors I want, I am still not able to change other parameters like:

    font-weight (I'd need this one ..)
    font-family
    text-decoration
    font-size

    Strange though that color works ...
    Even so does background-color ...
    Do you have any idea, why this does not work, or even better: any way to MAKE it work ??

    Thanks
    Wolfgang
    IP

  5. #5
    Join Date
    Aug 2000
    Location
    Las Vegas, NV
    Posts
    819

    Default

    ...but it seems only the background and text colors can be changed...I have no idea why. [img]/infopop/emoticons/icon_confused.gif[/img]

    The only work around I can think of would be to change the color of the other options to a dark gray, then the unchanged one would stand out...not a great solution though.

    Mickie
    IP

  6. #6
    Join Date
    Aug 2000
    Location
    Ingolstadt, Germany
    Posts
    358

    Default

    Select boxes tend to be implemented in browsers simply by using the operating system's built-in combo-box controls, which have very limited possibilities for customisation. In many browsers, even changing the colour won't work. Mozilla has its own implementations of all form controls, which gives you much more latitude for changing styles.
    IP

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •