Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <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>
              
            
!

CSS

              
                select {
  padding: 5px;
  width: 300px;
  display: block;
  margin: 0 0 10px;
}
label {
  display: block;
  margin: 0 0 5px;
}
              
            
!

JS

              
                
              
            
!
999px

Console