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

              
                <p><strong>INSTRUCTIONS: </strong>To see the focus styles working, you can click on the fields or use the TAB key to navigate the forms.</p>
<p>For comments and explanations, refer to the css comments. To see all the focus style activated for comparison click here: <a href="https://codepen.io/b_atish/full/mVNode" title="focus styles exposed codepen">https://codepen.io/b_atish/full/mVNode</a></p>
<div class="col">
  <h3>Browser default</h3>
   <div>
    <label for="name">Name</label>
    <input type="text" name="name" id="name" value="" />
  </div>
  <div>
    <label for="option0">Select</label>
    <select class="select" name="option0">
      <option value="" disabled selected>Choose your option</option>
      <option value="1">Option 1</option>
      <option value="2">Second Option A</option>
      <option value="3">Secondary      Opción B </option>
      <option value="3">Segunda Opción C </option>
      <option value="3">Third (or fifth) Option </option>
    </select>
  </div>
  <div>
    <label for="textarea0">Textarea</label>
    <textarea cols="40" rows="8" name="textarea0" id="textarea0"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox0" id="checkbox0" value="" />
    <label class="checkbox" for="checkbox0">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio0" id="radio0a" value="" />
    <label class="radio" for="radio0a">Female</label>
    <input type="radio" name="radio0" id="radio0b" value="" />
    <label class="radio" for="radio0b">Male</label>
    <input type="radio" name="radio0" id="radio0c" value="" />
    <label class="radio" for="radio0c">Other</label>
  </div> 
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>

<div class="glow col animated styled">
  <h3>Glow animated (text shadow)</h3>
   <div>
    <label for="name">Name</label>
    <input type="text" name="name" id="name" value="" />
  </div>
  <div>
    <label for="option">Select</label>
    <select class="select" name="option">
      <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>
    <label for="textarea">Textarea</label>
    <textarea cols="40" rows="8" name="textarea" id="textarea"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox" id="checkbox" value="" />
    <label class="checkbox" for="checkbox">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio" id="radioa" value="" />
    <label class="radio" for="radioa">Female</label>
    <input type="radio" name="radio" id="radiob" value="" />
    <label class="radio" for="radiob">Male</label> 
    <input type="radio" name="radio" id="radioc" value="" />
    <label class="radio" for="radioc">Other</label>
  </div>  
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>
  

<div class="outline col  styled">
  <h3>Outline</h3>
  <div>
    <label for="name1">Name</label>
    <input type="text" name="name" id="name1" value="" />
  </div>
  <div>
    <label for="option1">Select</label>
    <select class="select" name="option1">
      <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>
    <label for="textarea1">Textarea</label>
    <textarea cols="40" rows="8" name="textarea1" id="textarea1"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox1" id="checkbox1" value="" />
    <label class="checkbox" for="checkbox1">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio1" id="radioa1" value="" />
    <label class="radio" for="radioa1">Female</label>
    <input type="radio" name="radio1" id="radiob1" value="" />
    <label class="radio" for="radiob1">Male</label> 
    <input type="radio" name="radio1" id="radio1c" value="" />
    <label class="radio" for="radio1c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>


<div class="bg col styled">
  <h3>Background color</h3>
  <div>
    <label for="name2">Name</label>
    <input type="text" name="name" id="name2" value="" />
  </div>
  <div>
    <label for="option2">Select</label>
    <select class="select" name="option2">
      <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>
    <label for="textarea2">Textarea</label>
    <textarea cols="40" rows="8" name="textarea2" id="textarea2"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox2" id="checkbox2" value="" />
    <label class="checkbox" for="checkbox2">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio2" id="radioa2" value="" />
    <label class="radio" for="radioa2">Female</label>
    <input type="radio" name="radio2" id="radiob2" value="" />
    <label class="radio" for="radiob2">Male</label>
     <input type="radio" name="radio2" id="radio2c" value="" />
    <label class="radio" for="radio2c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>

<div class="border solid col styled">
  <h3>Border</h3>
  <div>
    <label for="name3">Name</label>
    <input type="text" name="name" id="name3" value="" />
  </div>
  <div>
    <label for="option3">Select</label>
    <select class="select" name="option3">
      <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>
    <label for="textarea3">Textarea</label>
    <textarea cols="40" rows="8" name="textarea3" id="textarea3"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox3" id="checkbox3" value="" />
    <label class="checkbox" for="checkbox3">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio3" id="radioa3" value="" />
    <label class="radio" for="radioa3">Female</label>
    <input type="radio" name="radio3" id="radiob3" value="" />
    <label class="radio" for="radiob3">Male</label>
     <input type="radio" name="radio3" id="radio3c" value="" />
    <label class="radio" for="radio3c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>

<div class="border dashed col styled">
  <h3>Border dashed</h3>
  <div>
    <label for="name4">Name</label>
    <input type="text" name="name" id="name4" value="" />
  </div>
  <div>
    <label for="option4">Select</label>
    <select class="select" name="option4">
      <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>
    <label for="textarea4">Textarea</label>
    <textarea cols="40" rows="8" name="textarea4" id="textarea4"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox4" id="checkbox4" value="" />
    <label class="checkbox" for="checkbox4">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio4" id="radioa4" value="" />
    <label class="radio" for="radioa4">Female</label>
    <input type="radio" name="radio4" id="radiob4" value="" />
    <label class="radio" for="radiob4">Male</label>
     <input type="radio" name="radio4" id="radio4c" value="" />
    <label class="radio" for="radio4c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>

<div class="border dotted col styled">
  <h3>Border dotted</h3>
  <div>
    <label for="name5">Name</label>
    <input type="text" name="name" id="name5" value="" />
  </div>
  <div>
    <label for="option5">Select</label>
    <select class="select" name="option5">
      <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>
    <label for="textarea5">Textarea</label>
    <textarea cols="40" rows="8" name="textarea5" id="textarea5"></textarea>
  </div>
<div>
    <input type="checkbox" name="checkbox5" id="checkbox5" value="" />
    <label class="checkbox" for="checkbox5">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio5" id="radioa5" value="" />
    <label class="radio" for="radioa5">Female</label>
    <input type="radio" name="radio5" id="radiob5" value="" />
    <label class="radio" for="radiob5">Male</label>
     <input type="radio" name="radio5" id="radio5c" value="" />
    <label class="radio" for="radio5c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>

<div class="border inset col styled">
  <h3>Border inset</h3>
  <div>
    <label for="name6">Name</label>
    <input type="text" name="name" id="name6" value="" />
  </div>
  <div>
    <label for="option6">Select</label>
    <select class="select" name="option6">
      <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>
    <label for="textarea6">Textarea</label>
    <textarea cols="40" rows="8" name="textarea6" id="textarea6"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox6" id="checkbox6" value="" />
    <label class="checkbox" for="checkbox6">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio6" id="radioa6" value="" />
    <label class="radio" for="radioa6">Female</label>
    <input type="radio" name="radio6" id="radiob6" value="" />
    <label class="radio" for="radiob6">Male</label>
     <input type="radio" name="radio6" id="radio6c" value="" />
    <label class="radio" for="radio6c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>

<div class="border outset col styled">
  <h3>Border outset</h3>
  <div>
    <label for="name7">Name</label>
    <input type="text" name="name7" id="name7" value="" />
  </div>
  <div>
    <label for="option7">Select</label>
    <select class="select" name="option7">
      <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>
    <label for="textarea7">Textarea</label>
    <textarea cols="40" rows="8" name="textarea7" id="textarea7"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox7" id="checkbox7" value="" />
    <label class="checkbox" for="checkbox7">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio7" id="radioa7" value="" />
    <label class="radio" for="radioa7">Female</label>
    <input type="radio" name="radio7" id="radiob7" value="" />
    <label class="radio" for="radiob7">Male</label>
     <input type="radio" name="radio7" id="radio7c" value="" />
    <label class="radio" for="radio7c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>



<div class="border ridge col styled">
  <h3>Border ridge</h3>
  <div>
    <label for="name9">Name</label>
    <input type="text" name="name9" id="name9" value="" />
  </div>
  <div>
    <label for="option9">Select</label>
    <select class="select" name="option9">
      <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>
    <label for="textarea9">Textarea</label>
    <textarea cols="40" rows="8" name="textarea9" id="textarea9"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox9" id="checkbox9" value="" />
    <label class="checkbox" for="checkbox9">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio9" id="radioa9" value="" />
    <label class="radio" for="radioa9">Female</label>
    <input type="radio" name="radio9" id="radiob9" value="" />
    <label class="radio" for="radiob9">Male</label>
     <input type="radio" name="radio9" id="radio9c" value="" />
    <label class="radio" for="radio9c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>

<div class="border groove col styled">
  <h3>Border groove</h3>
  <div>
    <label for="name10">Name</label>
    <input type="text" name="name10" id="name10" value="" />
  </div>
  <div>
    <label for="option10">Select</label>
    <select class="select" name="option10">
      <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>
    <label for="textarea10">Textarea</label>
    <textarea cols="40" rows="8" name="textarea10" id="textarea10"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox10" id="checkbox10" value="" />
    <label class="checkbox" for="checkbox10">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio10" id="radioa10" value="" />
    <label class="radio" for="radioa10">Female</label>
    <input type="radio" name="radio10" id="radiob10" value="" />
    <label class="radio" for="radiob10">Male</label>
     <input type="radio" name="radio10" id="radio10c" value="" />
    <label class="radio" for="radio10c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>

<div class="border double col styled">
  <h3>Border double</h3>
  <div>
    <label for="name8">Name</label>
    <input type="text" name="name8" id="name8" value="" />
  </div>
  <div>
    <label for="option8">Select</label>
    <select class="select" name="option8">
      <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>
    <label for="textarea8">Textarea</label>
    <textarea cols="40" rows="8" name="textarea8" id="textarea8"></textarea>
  </div>
  <div>
    <input type="checkbox" name="checkbox8" id="checkbox8" value="" />
    <label class="checkbox" for="checkbox8">Checkbox</label>
  </div>
  <div class="radio">
    <input type="radio" name="radio8" id="radioa8" value="" />
    <label class="radio" for="radioa8">Female</label>
    <input type="radio" name="radio8" id="radiob8" value="" />
    <label class="radio" for="radiob8">Male</label>
     <input type="radio" name="radio8" id="radio8c" value="" />
    <label class="radio" for="radio8c">Other</label>
  </div>
  <div class="actions"> 
    <a href="">Cancel</a>  
    <button type="button">Submit</button>
  </div> 
</div>


              
            
!

CSS

              
                body {
  font-family: sans-serif;
}
.col{
  float: left;
  padding: 0 15px 5px;
  border: 1px solid #ddd;
  min-height: 400px;
  width: 330px;
  margin: 5px;
}
.col div{
  min-height: 30px;
}

label {
  display:block;
  margin-top: 10px;
}
label.checkbox, 
label.radio{
  display:inline;
  box-sizing: border-box;
}
input[type='text'], input[type='date'],select, textarea{
  width: 200px;
}
textarea{
  height: 50px;
}



.actions{
  padding: 25px 0 0;
}
button{
  height: 36px;
  width: 150px;
  border-radius: 15px;
  background: teal;
  color: #fff;
  float: right;
  margin-top: -15px!important;
}
h3{
  background: #ddd;
  margin: 0 -15px;
  padding: 10px;
  
}


input[type=text], 
textarea, 
select{
    padding: 3px 0px 3px 3px;
    margin: 5px 1px 3px 0px;
}
/***************************************/
/*  Reset outline: none for different fields       */
/***************************************/
  .styled input[type=text], 
  .styled textarea, 
  .styled select{
    outline: none;
    border: 1px solid #DDDDDD;
  }

  .styled input[type=checkbox],
  .styled input[type=radio],
  .styled a,
  .styled button{
    outline: none;
  }

/***************************************************/
/*   fields focus styles                           */
/***************************************************/
.animated input[type=text], 
.animated input[type=checkbox],
.animated input[type=radio],
.animated textarea,
.animated select, 
.animated a,
.animated button{
  transition: all .5s ease-in-out;
  padding: 3px 0px 3px 3px;
  margin: 5px 1px 3px 0px;
}

.glow input[type=text]:focus,
.glow select:focus,
.glow input[type=checkbox]:focus,
.glow input[type=radio]:focus,
.glow textarea:focus,
.glow a:focus,
.glow button:focus{
  box-shadow:0 0 20px rgba(81, 203, 238, 1);
  border: 1px solid rgba(81, 203, 238, 1);
}

/*outline can be different than border (more than 1 px in this case) and not alter the layout*/
.outline input[type=text]:focus, 
.outline select:focus,
.outline input[type=checkbox]:focus,
.outline input[type=radio]:focus,
.outline textarea:focus,
.outline  a:focus,
.outline button:focus{
  outline: 3px solid rgba(81, 203, 238, 1);
}
/*Radio butotns and checkboxes do not accept background color, so we can add the focus to the sibling label by "+label"*/
.bg input[type=text]:focus, 
.bg select:focus,
.bg input[type=checkbox]:focus+label,
.bg input[type=radio]:focus+label,
.bg textarea:focus,
.bg a:focus,
.bg button:focus{
  background: rgba(81, 203, 238, 1);
}

/*default border of border style fields exagerated to 3px to see the differences in styles and for border left and right not to "break the layout alignment" */
.border input[type=text], 
.border select,
.border textarea ,
.border a:focus,
.border button:focus{
  outline: none;
  padding: 3px 0px 3px 3px;
  margin: 5px 1px 3px 0px;
  border: 3px solid #DDDDDD;
}
/*Radio butotns and checkboxes do not accept border, so we can add the focus to the sibling label*/
.border input[type=checkbox]:focus+label,
.border input[type=radio]:focus+label{
  border-bottom: 3px solid #DDDDDD;
}
/*if focus border is different than border (more than 3 px in this case) it will alter the layout*/
.border.solid input[type=text]:focus, 
.border.solid select:focus,
.border.solid textarea:focus,
.border.solid a:focus,
.border.solid button:focus{
  border: 3px  solid rgba(81, 203, 238, 1);
}
      .border input[type=checkbox]:focus+label,
      .border input[type=radio]:focus+label{
        border-bottom: 3px solid rgba(81, 203, 238, 1);
      }
.border.dashed input[type=text]:focus,
.border.dashed select:focus,
.border.dashed textarea:focus,
.border.dashed a:focus,
.border.dashed button:focus{
  border: 3px dashed rgba(81, 203, 238, 1);
}
      .border.dashed input[type=checkbox]:focus+label,
      .border.dashed input[type=radio]:focus+label{
        border-bottom: 3px dashed rgba(81, 203, 238, 1);
      }
.border.dotted input[type=text]:focus,
.border.dotted select:focus,
.border.dotted textarea:focus,
.border.dotted a:focus,
.border.dotted button:focus{
  border: 3px dotted rgba(81, 203, 238, 1);
}
      .border.dotted input[type=checkbox]:focus+label,
      .border.dotted input[type=radio]:focus+label{
        border-bottom: 3px dotted rgba(81, 203, 238, 1);
      }
.border.inset input[type=text]:focus, 
.border.inset select:focus,
.border.inset textarea:focus,
.border.inset a:focus,
.border.inset button:focus{
  border: 3px inset rgba(81, 203, 238, 1);
}
      .border.inset input[type=checkbox]:focus+label,
      .border.inset input[type=radio]:focus+label{
        border-bottom: 3px inset rgba(81, 203, 238, 1);
      }
.border.outset input[type=text]:focus,
.border.outset select:focus, 
.border.outset textarea:focus,
.border.outset a:focus,
.border.outset button:focus{
  border: 3px outset rgba(81, 203, 238, 1);
}
      .border.outset input[type=checkbox]:focus+label,
      .border.outset input[type=radio]:focus+label{
        border-bottom: 3px outset rgba(81, 203, 238, 1);
      }
/*border double needs at least 3 px to be seen*/
.border.double input[type=text]:focus, 
.border.double select:focus,
.border.double textarea:focus,
.border.double a:focus,
.border.double button:focus{
  border: 3px double rgba(81, 203, 238, 1);
}
      .border.double input[type=checkbox]:focus+label,
      .border.double input[type=radio]:focus+label{
        border-bottom: 3px double rgba(81, 203, 238, 1);
      }

.border.ridge input[type=text]:focus,
.border.ridge select:focus,
.border.ridge textarea:focus,
.border.ridge a:focus,
.border.ridge button:focus{
  border: 3px ridge rgba(81, 203, 238, 1);
}
      .border.ridge input[type=checkbox]:focus+label,
      .border.ridge input[type=radio]:focus+label{
        border-bottom: 3px ridge rgba(81, 203, 238, 1);
      }
.border.groove input[type=text]:focus,
.border.groove select:focus,
.border.groove textarea:focus,
.border.groove a:focus,
.border.groove button:focus{
  border: 3px groove rgba(81, 203, 238, 1);
}
      .border.groove input[type=checkbox]:focus+label,
      .border.groove input[type=radio]:focus+label{
        border-bottom: 3px groove rgba(81, 203, 238, 1);
      }




              
            
!

JS

              
                
              
            
!
999px

Console