cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <h1>Optgroups cause odd behaviour in iOS6</h1>

<p>Check out my article for more info: <a href="https://www.thecssninja.com/html/optgroup-ios6" target="_blank">https://www.thecssninja.com/html/optgroup-ios6</a></p>

<label>Big select with option groups</label>
<select id="catparentlocation" name="parentlocation" size="8" multiple="multiple"><option value="0">All Locations</option><option value="3000|12">All Australia</option><optgroup label="Major Cities" class="searchbox-group"><option value="1000|1">Sydney</option><option value="1002|1">Melbourne</option><option value="1004|1">Brisbane</option><option value="1005|1">Gold Coast</option><option value="1009|1">Perth</option><option value="1007|1">Adelaide</option><option value="1011|1">Hobart</option><option value="1013|1">Darwin</option><option value="3100|13">Canberra</option></optgroup><optgroup label="Regional" class="searchbox-group"><option value="3101|13">NSW</option><option value="3106|13">VIC</option><option value="3103|13">QLD</option><option value="3107|13">WA</option><option value="3104|13">SA</option><option value="3105|13">TAS</option><option value="3100|13">ACT</option><option value="3102|13">NT</option></optgroup><optgroup label="New Zealand" class="searchbox-group"><option value="3001|12">All New Zealand</option><option value="1018|1">Auckland</option><option value="5101|1">Northland</option><option value="5126|1">Waikato</option><option value="5089|1">Bay of Plenty</option><option value="5104|1">Gisborne</option><option value="5085|1">Hawkes Bay</option><option value="5082|1">Taranaki</option><option value="5097|1">Manawatu</option><option value="1019|1">Wellington</option><option value="5131|1">Tasman</option><option value="5079|1">Marlborough</option><option value="5113|1">Canterbury</option><option value="5093|1">Otago</option><option value="5123|1">West Coast</option><option value="5110|1">Southland</option></optgroup><optgroup label="UK &amp; Ireland" class="searchbox-group"><option value="3002|12">All UK &amp; Ireland</option><option value="5161|1">London</option><option value="5150|1">Rest of UK</option><option value="1025|1">Ireland</option></optgroup><optgroup label="Other" class="searchbox-group"><option value="3003|12">All Other</option><option value="5140|1">Asia Pacific</option><option value="5137|1">Americas</option><option value="5134|1">Europe &amp; Russia</option><option value="5147|1">Middle East &amp; Africa</option></optgroup></select>

<label>Small select with option group</label>
<select id="catchildlocation" data-multiple="true" name="childlocation" size="8" multiple="multiple"><option value="0">All Sydney</option><optgroup label="Sydney Areas" class="searchbox-group"><option value="5027">CBD, Inner West &amp; Eastern Suburbs</option><option value="5028">North Shore &amp; Northern Beaches</option><option value="5029">North West &amp; Hills District</option><option value="5030">Parramatta &amp; Western Suburbs</option><option value="5031">Ryde &amp; Macquarie Park</option><option value="5032">Southern Suburbs &amp; Sutherland Shire</option><option value="5033">South West &amp; M5 Corridor</option></optgroup></select>

<label>Select with no option group</label>
<select multiple="multiple">
  <option value="0">All Sydney</option>
  <option disabled style="font-weight: 700; color: #000;">Sydney Areas</option>
    <option value="5027">CBD, Inner West &amp; Eastern Suburbs</option>
    <option value="5028">North Shore &amp; Northern Beaches</option>
    <option value="5029">North West &amp; Hills District</option>
    <option value="5030">Parramatta &amp; Western Suburbs</option>
    <option value="5031">Ryde &amp; Macquarie Park</option>
    <option value="5032">Southern Suburbs &amp; Sutherland Shire</option>
    <option value="5033">South West &amp; M5 Corridor</option
</select>
            
          
!
            
              select {
  padding: 5px;
  width: 300px;
  display: block;
  margin: 0 0 10px;
}
label {
  display: block;
  margin: 0 0 5px;
}
            
          
!
999px
Loading ..................

Console