cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

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.

            
              <html>
  <head>
    <!-- Material Design icon font -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
  </head>
  <body>
    <div class="demo">
      <!-- Standard Select -->
      <div class="mdl-selectfield">
        <label>Standard Select</label>
        <select class="browser-default">
          <option value="" disabled selected>Choose your option</option>
          <option value="1">Option 1</option>
          <option value="2">Option 2</option>
          <option value="3">Option 3</option>
        </select>
      </div>
    </div>
    
    <p style="line-height:1.4;"><span style="font-weight: bold;">Material Design select element, css only.</span><br/>
      <a href="https://github.com/google/material-design-lite/issues/854" target="_blank">Github Issue</a> |
      <a href="http://www.google.com/design/spec/components/menus.html#menus-usage" target="_blank">Material Design Spec</a> |
      <a href="http://materializecss.com/forms.html" target="_blank">Materialize solution</a>
    </p>
  </body>
</html>

            
          
!
            
              /* ==========  Select Field Variables ========== */
$color-black: "0,0,0";
$select-background-color: transparent;
$select-border-color: unquote("rgba(#{$color-black}, 0.12)") !default;
$select-font-size: 16px;
$select-color: unquote("rgba(#{$color-black}, 0.26)") !default;
$select-padding: 4px;

/* ==========  Select Field ========== */

/* Style Select Field */
select {
  font-family: inherit;
  background-color: transparent;
  width: 100%;
  padding: $select-padding 0;
  font-size: $select-font-size;
  color: $select-color;
  border: none;
  border-bottom: 1px solid $select-border-color;
}

/* Remove focus */
select:focus {
  outline: none}

/* Hide label */
.mdl-selectfield label {display: none;}
/* Use custom arrow */
.mdl-selectfield select {appearance: none}
.mdl-selectfield {
  font-family: 'Roboto','Helvetica','Arial',sans-serif;
  position: relative;
    &:after {
        position: absolute;
        top: 0.75em;
        right: 0.5em;
        /* Styling the down arrow */
        width: 0;
        height: 0;
        padding: 0;
        content: '';
        border-left: .25em solid transparent;
        border-right: .25em solid transparent;
        border-top: .375em solid $select-border-color;
        pointer-events: none;
    }
}

/* ==========  Demo CSS ========== */
body {
  padding: 20px;
  background: #fafafa;
  font-family: 'Roboto','Helvetica','Arial',sans-serif;
}
.demo {
  width: 200px;
  padding: 20px;
  margin: 0 auto;
  top: 50%;
  margin-top: -2em;
  position: absolute;
  right: 0;
  left: 0;
}

            
          
!
            
              //
// Material Design <select> element, css only
// 
// - Github Issue: https://github.com/google/material-design-lite/issues/854
// - Material Design Spec: http://www.google.com/design/spec/components/menus.html#menus-usage (search for "Textfield dropdown")
// - Materialize solution: http://materializecss.com/forms.html

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console