cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              <div class="container">
	<h1>Some Basic Form Styling</h1>
	
<form>
  <div>
  <p>
    <label>
      text<br>
    <input type="text" placeholder="Placeholder" value="Default value">
    </label>
  </p>
  <p>
    <label>
      password<br>
    <input type="password" placeholder="Password">
    </label>
  </p>
  <p>
    <label>
      number<br>
    <input type="number" placeholder="123456789">
    </label>
  </p>
  <p>
    <label>
      email<br>
    <input type="email" placeholder="something@email.com">
    </label>
  </p>
  <p>
    <label>
      url<br>
    <input type="url" placeholder="http://website.com">
    </label>
  </p>
  <p>
    <label>
      tel<br>
    <input type="tel" placeholder="(123) 456-7890">
    </label>
  </p>
  <p>
    <label>
      search<br>
    <input type="search"  placeholder="Search">
    </label>
  </p>
  <p>
    <label>
      textarea<br>
      <textarea rows="5" cols="40" placeholder="Your message. I'm afraid I still don't understand, sir. Maybe if we felt any human loss as keenly as we feel one of those close to us, human history would be far less bloody."></textarea>
    </label>
  </p>
  <p>
    <label>
      date<br>
    <input type="date">
    </label>
  </p>
  <p>
    <label>
      datetime<br>
    <input type="datetime">
    </label>
  </p>
  <p>
    <label>
      datetime-local<br>
    <input type="datetime-local">
    </label>
  </p>
  <p>
    <label>
      month<br>
    <input type="month">
    </label>
  </p>
  <p>
    <label>
      week<br>
    <input type="week">
    </label>
  </p>
  <p>
    <label>
      time<br>
    <input type="time">
    </label>
  </p>
  <p>
    <label>
      select<br>
      <select>
					<option value="" disabled selected>Select...</option>
          <option>This is option 1</option>
          <option>This is option 2</option>
          <option>This is option 3</option>
      </select>
    </label>
  </p>
  <p>
    <label>
      select (multiple attr)<br>
      <select multiple>
          <option>This is option 1</option>
          <option>This is option 2</option>
          <option>This is option 3</option>
      </select>
    </label>
  </p>
  <p>
    <label>
      select (size attr)<br>
      <select size="2">
          <option>This is option 1</option>
          <option>This is option 2</option>
          <option>This is option 3</option>
      </select>
    </label>
  </p>
  <p>
    <label>
      datalist (Start typing This...)<br>
      <input list="datalist">
      <datalist id="datalist">
        	<option>This is option 1</option>
          <option>This is option 2</option>
          <option>This is option 3</option>
      </datalist>
    </label>
  </p>
  <p>
    <label>
      keygen<br>
      <keygen>
    </label>
  </p>
  <p>
    <label>
      output<br>
      <output>123</output>
    </label>
  </p>
  <p>
			<input type="radio" name="radio" value="Radio 1" id="rad1"><label for="rad1">Radio 1</label><br>
			<input type="radio" name="radio" value="Radio 2" id="rad2"><label for="rad2">Radio 2</label><br>
			<input type="radio" name="radio" value="Radio 3" id="rad3"><label for="rad3">Radio 3</label><br>
  </p>
  <p>
    <input type="checkbox" name="checkbox" value="Checkbox 1" id="cb1"><label for="cb1">Checkbox 1</label><br>
		<input type="checkbox" name="checkbox" value="Checkbox 2" id="cb2"><label for="cb2">Checkbox 2</label><br>
		<input type="checkbox" name="checkbox" value="Checkbox 3" id="cb3"><label for="cb3">Checkbox 3</label><br>
  </p>
  <p>
		<label>color</label>
    <input type="color">
  </p>
  <p>
    <label>
      range<br>
    <input type="range" id="rangeSlider" min="0" max="100" step="10" onchange="printValue('rangeSlider', 'rangeValue')">
		<input type="text" id="rangeValue" size="3">
    </label>
  </p>
  <p>
    <input type="file" name="file" id="file">
  </p>
  <p>
    <input type="submit">
  </p>
  <p>
    <input type="reset">
  </p>
  <p>
    <input type="button" value="Button (input tag)">
  </p>
  <p>
      <button>Button (button tag)</button>
  </p>
  </div>
  <fieldset>
    <legend>Legend</legend>
    Fieldset
  </fieldset>
</form>
</div>
            
          
!
            
              /* ------------------- */
/* TEMPLATE        -- */
/* ----------------- */

@import url(https://fonts.googleapis.com/css?family=Lato:400,700,900,300);
@import url(http://weloveiconfonts.com/api/?family=fontawesome);

* { box-sizing: border-box; }

body { 
	background-color: #333; 
	font-size: 1rem; 
	font-family: 'Lato';
} 

h1 { font-size: 2em; color: whitesmoke; font-weight: 400; margin-bottom: 0.5em; margin-top: 0; }
p { font-size: 1em; color: whitesmoke; margin-bottom: 1em; margin-top: 0; }
a { color: dodgerblue; text-decoration: none; border-bottom: 1px dotted; }
a:hover { color: tomato; }

.container { 
	max-width: 960px; 
	height: 100%;
	margin: 0 auto; 
	padding: 1.5em;
}

form > div {
	display: flex;
	flex-wrap: wrap;
}

form > div > p {
	min-width: 33.33%;
	padding: 10px;
}

form p { color: tomato; }

/* ------------------- */
/* Form Styles
/* ----------------- */

form > div { margin-bottom: 1em; }

button,
input,
optgroup,
select,
keygen::-webkit-keygen-select,
select[_moz-type="-mozilla-keygen"],
textarea {
	color: inherit;
	font: inherit;
	margin: 0;
	margin-top: 0.5em;
}

label {
	display: block;
	margin: 0.75em 0;
	font-weight: bold;
}

input[type="radio"] + label,
input[type="checkbox"] + label { 
	margin: 0;
	font-weight: 400; 
}

button,
input[type=button],
input[type=reset],
input[type=submit],
{
	-webkit-appearance: button;
	cursor: pointer;
}

button[disabled],
input[disabled] {
	cursor: default;
}

input {
	line-height: normal;
}

textarea { line-height: 1.25em; }

select {
	border: 1px solid #ccc;
	background-color: #fff;
}

input[type=checkbox],
input[type=radio] {
	box-sizing: border-box;
	padding: 0;
	display: block;
	margin-right: 0.25em;
	margin-top: 2px;
	float: left;
	clear: both;
}

input[type=search] {
		-webkit-appearance: textfield;
		-moz-box-sizing: content-box;
		-webkit-box-sizing: content-box;
	box-sizing: content-box;
}

input[type=search]::-webkit-search-cancel-button,
input[type=search]::-webkit-search-decoration {
	-webkit-appearance: none;
}

input[type=text],
input[type=password],
input[type=email],
input[type=url],
input[type=date],
input[type=month],
input[type=time],
input[type=datetime],
input[type=datetime-local],
input[type=week],
input[type=number],
input[type=search],
input[type=tel],
input[type=color],
select[_moz-type="-mozilla-keygen"],
keygen::-webkit-keygen-select,
select,
textarea {
	border: 1px solid #ccc;
	box-shadow: inset 0 1px 3px #ddd;
	border-radius: 2px;
	vertical-align: middle;
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
	box-sizing: border-box;
	max-width: 100%;
	padding: 0.5em 0.6em;
	margin-bottom: 0.5em;
}

input[type=color] {
	padding: 0;
}

input:not([type]) {
	display: inline-block;
	border: 1px solid #ccc;
	box-shadow: inset 0 1px 3px #ddd;
	border-radius: 2px;
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
	box-sizing: border-box;
	padding: 0.5em 0.6em;
}

input[type=color] {
	padding: 0.2em 0.5em;
}

input[type=file]:focus,
input[type=radio]:focus,
input[type=checkbox]:focus {
	outline: 1px auto #129FEA;
}

input[readonly],
select[readonly],
textarea[readonly] {
	background-color: #eee;
	color: #777;
	border-color: #ccc;
}

input:focus:invalid,
textarea:focus:invalid,
select:focus:invalid {
	color: #b94a48;
	border-color: #e9322d;
	}

input[type=file]:focus:invalid:focus,
input[type=radio]:focus:invalid:focus,
input[type=checkbox]:focus:invalid:focus {
	outline-color: #e9322d;
}


/* Style your form buttons. Follow your heart */

input[type="submit"],
input[type="reset"],
input[type="button"],
button {
	display: inline-block;
	padding: 8px 12px;
	color: white;
	background-color: tomato;
	border: 0;
	cursor: pointer;
	transition: all 300ms ease;
}

input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
button:hover {
	background-color: royalblue;
}
            
          
!
            
              // From Chris Smith's "All Form Elements" pen: https://codepen.io/chris22smith/pen/pymBWL


function printValue(sliderID, textbox) {
	 var x = document.getElementById(textbox);
	 var y = document.getElementById(sliderID);
	 x.value = y.value;
}

window.onload = function() { 
	printValue('rangeSlider', 'rangeValue');
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console