These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:10 pm Advanced search

Separator in dropdown list in HTML5

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Separator in dropdown list in HTML5

Postby dipanjan80 » Tue Dec 06, 2011 7:20 am

Hi,
I want a separator in my dropdown list.
My code goes like this....

Code: Select all
Option 1:
<select>
   <option>a</option>
<hr>
   <option>b</option>
   <option>c</option>
   <option>d</option>
</select>


But this is not being supported on HTML5.
I am using Mac. It was working fine on Snow Leopard OS, but in LION the separator is not coming at all.

Screen shot 2011-11-21 at 4.57.56 PM.png
Snow Leopard Screenshot
Screen shot 2011-11-21 at 4.57.56 PM.png (17.93 KiB) Viewed 8760 times


Screen Shot 2011-11-21 at 4.55.54 PM.png
LION Screenshot
Screen Shot 2011-11-21 at 4.55.54 PM.png (19.3 KiB) Viewed 8760 times
dipanjan80
<h6>
 
Posts: 1
Joined: Tue Dec 06, 2011 7:11 am

Re: Separator in dropdown list in HTML5

Postby JAB Creations » Tue Dec 06, 2011 6:36 pm

You should use the optgroup element as a parent to option elements. I haven't used it myself so I'm not sure if you can apply the border or outline properties to it; if not then I would recommend pushing for that instead of mixing elements by non-applicable context.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Re: Separator in dropdown list in HTML5

Postby zcorpan » Wed Dec 07, 2011 8:18 am

Which browser (and version) did you use for the screenshots?
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest