Issue
How do you make a separator in a select tag?
New Window
New Tab
-----------
Save Page
------------
Exit
Solution
The disabled option approach seems to look the best and be the best supported. I've also included an example of using the optgroup.
optgroup (this way kinda sucks):
<select>
<optgroup>
<option>First</option>
</optgroup>
<optgroup label="_________">
<option>Second</option>
<option>Third</option>
</optgroup>
</select>
disabled option (a bit better):
<select>
<option>First</option>
<option disabled>_________</option>
<option>Second</option>
<option>Third</option>
</select>
And if you want to be really fancy, use the horizontal unicode box drawing character.
(BEST OPTION!)
<select>
<option>First</option>
<option disabled>──────────</option>
<option>Second</option>
<option>Third</option>
</select>
Answered By - Alex K
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.