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 class="border1">Normal Document Flow in HTML</h1>
<div>This is a div. 
  <span> This is a span.</span>
  This is still the same div.
<div>

<p class="border1">This is a paragraph.</p>
<p class="plum">This is another paragraph.</p>
<div class="border1 plum">
  <p>This is a paragraph in a div.</p>
  <div>This is a div in a div.</div>
</div>
              
            
!

CSS

              
                .plum { background: plum }
.border1 { border: 1px solid blue }

/*
h1 { background: plum; border: 1px solid blue }

div { background: plum; border: 1px solid blue }

p { background: plum; border: 1px solid blue }
*/

/*
HTML conclusions:
1. We can add a class attribute to any html tag. 2. Using class attributes in HTML is just a different way of tagging text on our web page.
3. Now any of our elements can have some additional information, provided in a class.
4. We can provide as many class names as we want to our class attribute. Just remember to separate class names with a space!


CSS conclusions:
1. To tell to CSS that we're targeting a class attribute in an HTML element, we need to put a dot in front of a class name. 
2. We follow it up with the actual class name.
3. Here's the formula:
.classname {
  property: value;
  property: value;
  ....
}
4. We can stick to only 1 property: value per class:

.classname {
  property: value
}

5. Or we can add as many property: value pairs as we like: 
. classname {
  property: value;
  property: value;
  property: value
}

*/


              
            
!

JS

              
                
              
            
!
999px

Console