SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    IE support of stylizing option tags

    Seems IE's support is of stylizing <option> tags is extremely limited. Doesn't seem to support font-weight, font-style, or text-indent. So far changing the background collor seems to be the only effective way I have to differentiate some options from others. Anyone know of any other ways I can differentiate some options from others? Changing the background color isn't quite ideal and would like to consider alternatives if possible.

  2. #2
    Beer Monster -Ox's Avatar
    Join Date
    Apr 2003
    Location
    sowth afreeka
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Howdy,

    Its pretty limited as to what you can do indeed, you can change the font style in the <select> tag however that changes everthing inside it. you can pretty much only change the background and the font colour per options tag as far as I know.

    A suggestion perhaps would be to use the <optgroup> to define different "sections" of your <select> for example:
    Code:
    <select>
    
    	<optgroup label="Option group 1">
    		<option>option 1</option>
    		<option>option 2</option>
    		<option>option 3</option>
    		<option>option 4</option>
    		
    	</optgroup>
    	
    	<optgroup label="Option group 2">
    		<option>option 5</option>
    		<option>option 6</option>
    		<option>option 7</option>
    		<option>option 8</option>
    	</optgroup>
    	
    </select>
    Maybe that helps
    My postings are a natural product.
    The slight variations in spelling and grammar enhance its
    individual character and beauty and in no way are to be
    considered flaws or defects - http://www.guinnesspig.net

  3. #3
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    <optgroup> visually does exactly what I want but with one major flaw: you cannot click on the <optgroup> label. I'm going to be using this <select> as a navigational element and need to be able to click on the label to go to that page. I was able to mimic the appearance of an <optgroup> through CSS for Gecko-based browsers but IE just doesn't seem to want to play ball.

  4. #4
    Beer Monster -Ox's Avatar
    Join Date
    Apr 2003
    Location
    sowth afreeka
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got to love IE man

    maybe try and offset them somewhat almost like a tree menu would look like something like

    Code:
    <select>
    	<option style="background: #CCCCCC;">Main 1</option>
    	
    	<option>&nbsp;&nbsp;&nbsp;+ Sub options 1</option>
    	<option>&nbsp;&nbsp;&nbsp;+ Sub options 2</option>
    	<option>&nbsp;&nbsp;&nbsp;+ Sub options 3</option>
    	<option>&nbsp;&nbsp;&nbsp;+ Sub options 4</option>
    
    	<option style="background: #FF0000;">Main 2</option>
    	
    	<option>&nbsp;&nbsp;&nbsp;+ Sub options 5</option>
    	<option>&nbsp;&nbsp;&nbsp;+ Sub options 6</option>
    	<option>&nbsp;&nbsp;&nbsp;+ Sub options 7</option>
    	<option>&nbsp;&nbsp;&nbsp;+ Sub options 8</option>
    
    </select>
    Lemme know how you come along, maybe that helps

    /Ox
    My postings are a natural product.
    The slight variations in spelling and grammar enhance its
    individual character and beauty and in no way are to be
    considered flaws or defects - http://www.guinnesspig.net

  5. #5
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Hmmm, not a bad idea. That should help me get closer to the effect I am after.

  6. #6
    Beer Monster -Ox's Avatar
    Join Date
    Apr 2003
    Location
    sowth afreeka
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its not the greatest way of doing it, cause ultimatly you would prolly wanna slap some padding-left: in the option tag, but it doesnt read that, so I spose this would have to be the closest to the next best thing
    My postings are a natural product.
    The slight variations in spelling and grammar enhance its
    individual character and beauty and in no way are to be
    considered flaws or defects - http://www.guinnesspig.net

  7. #7
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Since I'm trying to support NN4 also this site is certainly not going to be using the latest and greatest coding techniques so that method should work just fine.


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
  •