tags:

views:

2085

answers:

1

How do you make a separator in a select tag?

New Window
New Tab
-----------
Save Page
------------
Exit
+8  A: 

Try:

<optgroup label="----------"></optgroup>
Tina Orooji
http://www.w3.org/TR/html401/interact/forms.html#h-17.6
Boris Guéry
Instead of putting a label on the optgroups, try adding this to your stylesheet:optgroup + optgroup { border-top: 1px solid black }Much less cheesy looking than a bunch of dashes.
Laurence Gonsalves
Optgroup labels should describe the group. If a browser implemented on as per the screenshot in the HTML 4.01 spec, then the user would be confronted with rows of dashes and would have to examine each one to find out what was behind it.
David Dorward
I had never heard of optgroup. Thanks everyone!
cf_PhillipSenn
@Laurence: IE7 does not support css styles on optgroup or option elements. At least not borders
grom