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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <!DOCTYPE html>
<html lang="en-US">

<head>
  <meta charset="utf-8" />
  <meta name="author, viewport" content="Peter G. Morales, width=device-width, initial-scale=1">
  <meta name="description" content="This is the MDN Selectors Page Assessment for the CSS Building Blocks module of the MDN Learning Area.">
  <title>Selectors: Class and ID Selectors</title>
  <link href="styles/styles.css" rel="stylesheet" type="text/css">
</head>

<body>

  <div class="container">
    <h1>This is a heading</h1>
    <p>Veggies es
      <span class="alert">bonus vobis</span>, proinde vos postulo
      <span class="alert stop">essum magis</span>
      kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.
    </p>
    <h2 id="special">A level 2 heading</h2>
    <p>Gumbo beet greens corn soko endive gumbo gourd.</p>
    <h2>Another level 2 heading</h2>
    <p>
      <span class="alert go">Parsley shallot</span>
      courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber earthnut
      pea peanut soko zucchini.
    </p>
  </div>
</body>

</html>

<!-- https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Selectors_Tasks#task_2 -->
              
            
!

CSS

              
                body {
  background-color: #fff;
  color: #333;
  font: 1.2em / 1.5 Helvetica Neue, Helvetica, Arial, sans-serif;
  padding: 1em;
  margin: 0;
}

* {
  box-sizing: border-box;
}

/* Give the element with an id of special a yellow background. */
#special {
  background-color: yellow;
}

/* Give the element with a class of alert a 1px grey border. */
.alert {
  border: 1px solid grey;
}

/* If the element with a class of alert also has a class of stop, make the background red. */
.alert.stop {
  background-color: red;
}

/* If the element with a class of alert also has a class of go, make the background green. */
.alert.go {
  background-color: green;
}

              
            
!

JS

              
                
              
            
!
999px

Console