cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              
<body>
  <div class="wrapper">
    <header>
      <h1>A Header is block level</h1>
      
      <nav>
        <ul>
          <li>page1</li>
          <li>page2</li>
          <li>page3</li>
          <li>page4</li>
        </ul>
      </nav>
    </header>
    
    <div class="main">
      <article>        
        <blockquote>
          Block-level elements ... most significant characteristic is that they typically are formatted with a line break before and after the element (thereby creating a stand-alone block of content). That is, they take up the width of their containers. (MDN HTML Reference)
        </blockquote>
        
        <p>Block level elements take up 100% of the width of the parent container. (Unless a width is specified.) They can be assigned width, height, margin and padding. </p>
        
        <p>Block level elements are automatically placed on the next line after the previous block level element. This is the normal document flow when you don't use positioning or floats.</p>
        
        <p></p>
      
      </article>
      <h2>Inline Elments</h2>
      
      <p>Here are some inline elements: 
        <span>This is a span.</span>
      
        <em>This is emphasis.</em>
      
        <strong>This is strong.</strong>
        
        <a href="#">This is an anchor tag (link).</a>
      </p>
      
      <p>And here is an image: <img src="https://raw.githubusercontent.com/lisacatalano/block/master/pumpkin.jpg" alt=""> which is also an inline element.</p>
      
      <p>
        <span> </span> 
        <em> </em> 
        <strong> </strong> 
        <a href=""> </a>
      </p>
    </div>
    
    <footer>
      <p>&copy; css-snippets.com</p>
    </footer>  
    
  
  </div>
</body>
            
          
!
            
              * { margin: 0; padding: 0 }

body { 
  background-color: #eee;
  font-family: sans-serif;
  font-size: .9em; 
}

.wrapper {
  width: 500px;
  background-color: white; 
  margin: 0 auto;
  padding: 1em;
}

/* Block Level elements */
h1, h2, h3, p, 
div, 
nav, article, header, footer, 
ul, li, 
blockquote 
{ 
  background-color: #ddd;
  margin-bottom: 5px;
  padding: 5px;
/*  width: 70%;*/
}

li { 
  display:inline;
  height: 100px;
  width: 200px;
  margin: 0 20px;
  padding: 15px;
  background-color: #fff;
}

blockquote { 
  font-style: italic;
/*  height: 100px;*/
}
footer {
  height: 100px;
}

/* Inline elements */
span, em, strong, a, img, cite {
  background-color: #92CACA; 
  padding: 0px 5px;
  margin: 10px;
/*  height: 50px;*/
/*  width: 30px;*/
  display: block;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console