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

              
                <h1>Sample Form with Very Basic Styling</h1>
<form>
  <div>
    <label for="name">Name:
      <input type="text" id="name" name="name"></label><br>
    <label for="nick">Nickname:
      <input type="text" id="nick" name="nick"></label><br>
    <label for="email">Email:
      <input type="email" id="email" name="email"></label><br>
    <label for="birth">Birthday:
      <input type="date" id="birth" name="birth"></label>
  </div>
  <fieldset>
    <legend>Languages you know:</legend>
    <label for="c">
      <input type="checkbox" id="c" name="c">C/C++</label>
    <label for="java">
      <input type="checkbox" id="java" name="java" checked>Java</label>
    <label for="php">
      <input type="checkbox" id="php" name="php">PHP</label>
    <label for="python">
      <input type="checkbox" id="python" name="python">Python</label>
    <label for="basic">
      <input type="checkbox" id="basic" name="basic">Visual Basic</label>
  </fieldset>

  <fieldset>
    <legend>Hours per week spent programming:</legend>
    <label for="low">
      <input type="radio" id="low" name="timeCoding">Less than 8</label>
    <label for="med">
      <input type="radio" id="med" name="timeCoding">8 to 24</label>
    <label for="high">
      <input type="radio" id="high" name="timeCoding">more than 24</label>
  </fieldset>

  <div><input type="submit"></div>

</form>
              
            
!

CSS

              
                form {
  border: 0.25em solid green;
  box-shadow: 0.25em 0.25em 0.2em #777;
  margin: 0.35em;
  padding: 0.5em;
}

div {
  margin: 0.5em 0.25em;
}

input {
  margin: 0.3em 0px;
}

label,
legend,
input[type="submit"] {
  font-weight: bold;
}

input[type="text"],
input[type="date"],
input[type="email"] {
  background-color: #c8e6c9;
  border: 0px;
  border-bottom: 0.1em solid green;
  border-top: 0.1em solid green;
}

fieldset {
  border: 0.1em solid green;
}

fieldset,
input[type="submit"] {
  border-radius: 5px;
}

fieldset label {
  display: inline;
  margin: 0.25em 0.5em;
}
fieldset input {
  margin-right: 0.25em;
}

legend {
  color: green;
}

input[type="submit"] {
  background-color: #c8e6c9;
  border: 0.15em solid green;
  padding: 0.3em;
}

input[type="submit"]:hover {
  background-color: green;
  color: white;
}

@media only screen and (max-width: 768px) {
  div label,
  div input {
    display: block;
  }
  div input {
    margin: 0.2em 0px;
  }
  fieldset label {
    display: block;
  }
  form {
    min-width: 400px;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console