Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

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.

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

              
                <form action="#" autocomplete="off" method="get" novalidate>

  <fieldset>
    <legend>Basic</legend>
    <div>
      <label for="pet-select">Choose a pet</label>
      <select name="pets" id="pet-select">
        <option value="">One of these cuddly options…</option>
        <option value="dog">Dog</option>
        <option value="cat">Cat</option>
        <option value="hamster">Hamster</option>
        <option value="parrot">Parrot</option>
        <option value="spider">Spider</option>
        <option value="goldfish">Goldfish</option>
      </select>
    </div>
  </fieldset>

  <fieldset>
    <legend>Multitple</legend>
    <div>
      <label for="pet-select3">Choose a pet</label>
      <select name="pets" id="pet-select3" multiple size="6">
        <option value="">One of these cuddly options…</option>
        <option value="dog">Dog</option>
        <option value="cat">Cat</option>
        <option value="hamster">Hamster</option>
        <option value="parrot">Parrot</option>
        <option value="spider">Spider</option>
        <option value="goldfish">Goldfish</option>
      </select>
    </div>
  </fieldset>

  <fieldset>
    <legend>Disabled</legend>
    <div>
      <label for="pet-select2">Choose a pet</label>
      <select name="pets" id="pet-select2" disabled>
        <option value="">One of these cuddly options…</option>
        <option value="dog">Dog</option>
        <option value="cat">Cat</option>
        <option value="hamster">Hamster</option>
        <option value="parrot">Parrot</option>
        <option value="spider">Spider</option>
        <option value="goldfish">Goldfish</option>
      </select>
    </div>
  </fieldset>

  <fieldset>
    <legend>Disabled Multiple</legend>
    <div>
      <label for="pet-select7">Choose a pet</label>
      <select name="pets" id="pet-select7" multiple disabled>
        <option value="">One of these cuddly options…</option>
        <option value="dog">Dog</option>
        <option value="cat">Cat</option>
        <option value="hamster">Hamster</option>
        <option value="parrot">Parrot</option>
        <option value="spider">Spider</option>
        <option value="goldfish">Goldfish</option>
      </select>
    </div>
  </fieldset>

  <fieldset>
    <legend>Required</legend>
    <div>
      <label for="pet-select4">Choose a pet</label>
      <select name="pets" id="pet-select4" required>
        <option value="">One of these cuddly options…</option>
        <option value="dog">Dog</option>
        <option value="cat">Cat</option>
        <option value="hamster">Hamster</option>
        <option value="parrot">Parrot</option>
        <option value="spider">Spider</option>
        <option value="goldfish">Goldfish</option>
      </select>
    </div>
  </fieldset>

  <fieldset>
    <legend>Required Multiple</legend>
    <div>
      <label for="pet-select8">Choose a pet</label>
      <select name="pets" id="pet-select8" required multiple>
        <option value="">One of these cuddly options…</option>
        <option value="dog">Dog</option>
        <option value="cat">Cat</option>
        <option value="hamster">Hamster</option>
        <option value="parrot">Parrot</option>
        <option value="spider">Spider</option>
        <option value="goldfish">Goldfish</option>
      </select>
    </div>
  </fieldset>

  <fieldset>
    <legend>Errored</legend>
    <div>
      <label for="pet-select5">Choose a pet</label>
      <select name="pets" id="pet-select5" aria-invalid="true">
        <option value="">One of these cuddly options…</option>
        <option value="dog">Dog</option>
        <option value="cat">Cat</option>
        <option value="hamster">Hamster</option>
        <option value="parrot">Parrot</option>
        <option value="spider">Spider</option>
        <option value="goldfish">Goldfish</option>
      </select>
    </div>
  </fieldset>

  <fieldset>
    <legend>Errored Multiple</legend>
    <div>
      <label for="pet-select9">Choose a pet</label>
      <select name="pets" id="pet-select9" aria-invalid="true" multiple>
        <option value="">One of these cuddly options…</option>
        <option value="dog">Dog</option>
        <option value="cat">Cat</option>
        <option value="hamster">Hamster</option>
        <option value="parrot">Parrot</option>
        <option value="spider">Spider</option>
        <option value="goldfish">Goldfish</option>
      </select>
    </div>
  </fieldset>

  
  
  
  <fieldset dir="rtl" lang="ar">
    <legend>الأساسي</legend>
    <div>
      <label for="pet-select11">اختر حيوانًا أليفًا</label>
      <select name="pets" id="pet-select11" required aria-invalid="true">
        <option value="">أحد هذه الخيارات المحببة…</option>
        <option value="dog">الكلب</option>
        <option value="cat">قط</option>
        <option value="hamster">الهامستر</option>
        <option value="parrot">ببغاء</option>
        <option value="spider">العنكبوت</option>
        <option value="goldfish">ذهبية</option>
      </select>
    </div>
  </fieldset>

  <fieldset dir="rtl" lang="ar">
    <legend>مضاعف</legend>
    <div>
      <label for="pet-select12">اختر حيوانًا أليفًا</label>
      <select name="pets" id="pet-select12" multiple size="6" required aria-invalid="true">
        <option value="">أحد هذه الخيارات المحببة…</option>
        <option value="dog">الكلب</option>
        <option value="cat">قط</option>
        <option value="hamster">الهامستر</option>
        <option value="parrot">ببغاء</option>
        <option value="spider">العنكبوت</option>
        <option value="goldfish">ذهبية</option>
      </select>
    </div>
  </fieldset>

</form>
              
            
!

CSS

              
                body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.4;
  /*   line-height: 1.5; */
  /*   letter-spacing: 0.12em; */
  /*   word-spacing: 0.16em; */
}

@media print {
  body {
    font-size: 8pt;
  }
}

/*-- forms --*/

form {
  background-color: #fff;
  padding: 0.5em 1em;
  display: grid;
  grid-template-columns: repeat(2, [col] 1fr);
}

fieldset {
  padding: 0 1em;
  margin: 0 0.5em 1em 0.5em;
}

form details div {
  display: inline-block;
  margin: 0.25em;
}

form div {
  box-sizing: border-box;
  margin: 1em 0;
}

label {
  display: block;
  margin: 0.25em 0;
}

/*-- selects --*/

select {
  /*  the bare minimum  */
  font: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  /*  match my text boxen styles  */
  border: 0.1em solid;
  padding: 0 0.2em;
  /*  from Filament  */
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
}

select:not([multiple]) {
  /*  mine again  */
  padding-right: 1.2em;
  background-repeat: no-repeat;
  background-position: calc(100% - 0.25em) 0.35em;
  background-size: 0.85em auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M70.3 13.8L40 66.3 9.7 13.8z' fill='%23000'%3E%3C/path%3E%3C/svg%3E");
}

*[dir="rtl"] select:not([multiple]) {
  padding-right: 0.2em;
  padding-left: 1.2em;
  background-position: 0.25em 0.35em;
}

/* Filament: Hide arrow icon in IE browsers */
select::-ms-expand {
  display: none;
}

/* Focus */

select:focus {
  outline: 0.15em solid #00f;
  box-shadow: 0 0 0.2em #00f;
}

/* Errored */

select[aria-invalid] {
  background: linear-gradient(
    135deg,
    rgba(255, 0, 0, 1) 0,
    rgba(255, 0, 0, 1) 0.4em,
    rgba(255, 255, 255, 0) 0.4em
  );
}

select[aria-invalid]:not([multiple]) {
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 0.25em) 0.35em;
  background-size: 0.85em auto;
  background-image: linear-gradient(
      135deg,
      rgba(255, 0, 0, 1) 0,
      rgba(255, 0, 0, 1) 0.4em,
      rgba(255, 255, 255, 0) 0.4em
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M70.3 13.8L40 66.3 9.7 13.8z' fill='%23000'%3E%3C/path%3E%3C/svg%3E");
}

/* RTL Errored */

*[dir="rtl"] select[aria-invalid] {
  background: linear-gradient(
    225deg,
    rgba(255, 0, 0, 1) 0,
    rgba(255, 0, 0, 1) 0.4em,
    rgba(255, 255, 255, 0) 0.4em
  );
}

*[dir="rtl"] select[aria-invalid]:not([multiple]) {
  background: linear-gradient(
    225deg,
    rgba(255, 0, 0, 1) 0,
    rgba(255, 0, 0, 1) 0.4em,
    rgba(255, 255, 255, 0) 0.4em
  ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M70.3 13.8L40 66.3 9.7 13.8z' fill='%23000'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: auto, 0.85em auto;
  background-position: 0 0, 0.25em 0.35em;
}

/* Required */

select[required] {
  border-left-width: 0.3em;
}

/* RTL Required */

*[dir="rtl"] select[required] {
  border-left-width: 0.1em;
  border-right-width: 0.3em;
}

/* Dark mode */
/*
@media screen and (prefers-color-scheme: dark) {
  form {
    background-color: #000;
    color: #fff;
  }

  select {
    background-color: transparent;
    color: inherit;
    border-color: #ccc;
  }
  
  select:not([multiple]) option {
    color: initial;
  }

  select:focus {
    outline-color: #0ff;
    box-shadow: 0 0 0.2em #0ff;
  }

  select:disabled {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
  }

  select[readonly] {
    border-color: #777;
  }

  select[aria-invalid] {
    background: linear-gradient(
      135deg,
      rgba(238, 0, 0, 1) 0,
      rgba(238, 0, 0, 1) 0.3em,
      rgba(0, 0, 0, 0) 0.3em
    );
  }

  *[dir="rtl"] select[aria-invalid] {
    background: linear-gradient(
      225deg,
      rgba(238, 0, 0, 1) 0,
      rgba(238, 0, 0, 1) 0.3em,
      rgba(0, 0, 0, 0) 0.3em
    );
  }
}
*/

              
            
!

JS

              
                // https://github.com/filamentgroup/select-css/blob/master/src/select-css.css
              
            
!
999px

Console