Pen Settings



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


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


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.


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.


    <h1>Disabled and Read-Only Form Fields</h1>
    <form class="flow">
        <legend>Disabled Buttons</legend>
        <!-- To disable a form element, such as a button, simply add the disabled attribute. -->
        <button disabled>Submit</button>

        <!-- This button has custom classes for style, but still uses the disabled attribute -->
        <button class="btn btn__disabled" disabled>Submit</button>

        <!-- Custom widgets that need to be disabled should use the aria-disabled="true" attribute --> 
        <div role="button" tabindex="0" class="btn btn__disabled" aria-disabled="true">Submit</div>
        <legend>Read-Only Fields</legend>
        <!-- The readonly attribute can be used to tell screen-readers which fields are operational but not editable. You can also target the readonly attribute using CSS to present a different visual style -->
        <label for="name">Name</label>
        <input type="text" id="name" />
        <label for="location">Location</label>
        <input type="text" id="location" value="Burlington, VT" readonly />


                :root {
  --space: 1.5rem;

body {
  background-color: #bebebe;
  display: grid;
  place-items: center;
  align-items: center;
  padding: var(--space);

main {
  background-color: #fefefe;
  padding: calc(var(--space) * 2);
  max-width: 70ch;
  border-radius: 0.25rem;

.flow > * + * {
  margin-top: var(--space);

article {
  margin-top: 3rem;

input {
  border-radius: 0.25rem;
  padding: 0.5rem;

.example {
  outline: 1px solid #efefef;
  padding: 1rem;
  border-left: 4px solid;

.example__bad {
  border-left-color: red;

.example__good {
  border-left-color: green;

.example__goodinput[required] input[required] {
  border: 2px solid #222;

label + input[type="text"] {
  display: block;

.btn {
  /* resets all of the buttons default styles, other than text direction */
  all: unset;
  display: inline-block;
  padding: 0.5rem;
  border: 1px solid #404040;
  border-radius: 0.25rem;
  text-transform: uppercase;
  transition: 0.05s ease-in-out;
  max-width: 100px;

.btn:hover {
  cursor: pointer;

.btn:focus {
  transform: scale(1.1);

.btn__disabled {
  color: #bbb;
  background-color: #eee;
  border-color: #bbb;

.btn__disabled:hover {
  cursor: not-allowed;

[readonly] {
  background-color: #eee;
  color: #aaa;

/* Utility Classes */

.required {
  color: red;

.required + input {
  background-color: #efefef;

.d-block {
  display: block;

.txt-small {
  font-size: 90%;

.txt-light {
  color: #444444;