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

              
                <label for="standard-select">Default Select Menu </label>
<div class="select">
  <select id="standard-select">
    <option value="Option 1">Twitter </option>
    <option value="Option ">Facebook</option>
    <option value="Option 3">Reddit </option>
    <option value="Option 4">Youtube </option>

  </select>
  <span class="focus"></span>
</div>

<label for="multi-select">Multiple Selection</label>
<div class="select select--multiple">
  <select id="multi-select" multiple>
    <option value="Option 1">Web Development </option>
    <option value="Option 2">App Development </option>
    <option value="Option 3"> Machine Learning</option>
    <option value="Option 4">Automation </option>
    <option value="Option 5"> AI</option>
    <option value="Option length">Some other</option>
  </select>
  <span class="focus"></span>
</div>

<label for="standard-select-disabled">Disabled Select</label>
<div class="select select--disabled">
  <select id="standard-select-disabled" disabled>
    <option value="Option 1">Server side rendering</option>
    <option value="Option 2">Client side rendering</option>
    <option value="Option 3">Static site generation</option>
    <option value="Option 4">Hybrid Site Generator</option>
    <option value="Option 5">Server + Client side rendering</option>
    <option value="Option length">Single Page Application</option>
  </select>
</div>

<label for="standard-select">Disabled Multiple Select</label>
<div class="select select--disabled select--multiple">
  <select id="multi-select-disabled" multiple disabled>
    <option value="Option 1">React JS</option>
    <option value="Option 2">Angular JS</option>
    <option value="Option 3">Meteor JS</option>
    <option value="Option 4">Svelte Kit </option>
    <option value="Option 5">Hydrogen JS</option>
    <option value="Option length">React JS with NextJS </option>
  </select>
</div>
              
            
!

CSS

              
                body {
  background-color: red;
}
:root {
  --select-border: #777;
  --select-focus: #00f;
  --select-arrow: var(--select-border);
}
select {
  appearance: none;
  background-color: transparent;
  border: none;
  padding: 0 1em 0 0;
  margin: 0;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  cursor: inherit;
  line-height: inherit;
  z-index: 1;
  outline: none;
}

.select {
  display: grid;
  grid-template-areas: "select";
  align-items: center;
  position: relative;
  min-width: 15ch;
  max-width: 30ch;
  border: 1px solid var(--select-border);
  border-radius: 0.25em;
  padding: 0.25em 0.5em;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1.1;
  background-color: #fff;
  background-image: linear-gradient(to top, #f9f9f9, #fff 33%);
}
.select select,
.select::after {
  grid-area: select;
}
.select:not(.select--multiple)::after {
  content: "";
  justify-self: end;
  width: 0.8em;
  height: 0.5em;
  background-color: var(--select-arrow);
  clip-path: polygon(100% 0%, 0 0%, 50% 100%);
}
select:focus + .focus {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border: 2px solid var(--select-focus);
  border-radius: inherit;
}
select[multiple] {
  padding-right: 0;
  /*
   * Safari will not reveal an option
   * unless the select height has room to 
   * show all of it
   * Firefox and Chrome allow showing 
   * a partial option
   */
  height: 6rem;
  /* 
   * Experimental - styling of selected options
   * in the multiselect
   * Not supported crossbrowser
   */
}
select[multiple] option {
  white-space: normal;
  outline-color: var(--select-focus);
}
.select--disabled {
  cursor: not-allowed;
  background-color: #eee;
  background-image: linear-gradient(to top, #ddd, #eee 33%);
}
label {
  font-size: 1.125rem;
  font-weight: 500;
}
.select + label {
  margin-top: 2rem;
}
body {
  min-height: 100vh;
  display: grid;
  place-content: center;
  grid-gap: 0.5rem;
  font-family: "Baloo 2", sans-serif;
  background-color: pink;
  padding: 1rem;
}

              
            
!

JS

              
                
              
            
!
999px

Console