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>Normal Flow</h1>
<h2>Block and Inline Level Elements</h2>
<h3>Basic document order of default elements visually rendered by the browser</h3>

<p>This is a basic block level element (a paragraph). As a block-level element, I stack on top of other block-level elements. Adjacent (sibling) block-level elements sit on new lines below me.</p>

<p>By default, block-level elements are rendered at 100% of the width of our parent element, and as tall as the content inside of us and our total rendered width and height is our content + padding + border width/height (box-sizing: content-box).</p>

<p>Block level elements are separated by margins. Due to "margin collapsing" they are separated by the size of only one margin, not both, when placed one after another. Some common block level elements are divs, headings (h1, h2, etc), paragraphs (p), lists (ul, ol), and list items (li).</p>

<p>Inline elements such as this <span>span element</span> and this <span>span element</span> are rendered "inline" or on the same line as one another, as adjacent/sibling text nodes, and will appear next to one another so long as there is anough space on the same line. Overflowing inline elements will <span>wrap onto a new line if possible (e.g. span elements containing lots of text lorem ispum et dolorem)</span>.  Some common inline level elements are spans, images (img), and links (a).</p>

<!-- Original Source found via MDN: https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow -->
              
            
!

CSS

              
                body {
  max-width: 500px;
  margin: 0 auto;
}

p {
  background: rgba(255,0,0,0.3); 
  border: 2px solid rgb(255,0,0);
  padding: 10px;
  margin: 10px;
}

span {
  background: white;
  border: 1px solid black;
}
              
            
!

JS

              
                
              
            
!
999px

Console