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

              
                <div class="app">
  <header>
    <a href="">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/154571/Official.png" alt="Earth News">
    </a>
  </header>
  <nav>
    <a href="#" aria-current="page">Home</a>
    <a href="#">Podcast</a>
    <a href="#">Contact</a>
  </nav>
  <main>
    <h1><span>H<sub>2</sub>O</span> Fresh Air,<br>Bright Future</h1>
    <p>What a wonderful joy it is to see,
the beauty of nature and its majesty.
Everything blends, entwines and embraces,
Spaced precisely in their designated places.
What a marvel to see, I wish I were a bee,
flying free, smelling life’s roses, no particular place to be.</p>
    <a href="">Read full article</a>
  </main>
</div>
              
            
!

CSS

              
                :root {
  --var-padding: 1em;
  --highlight: hsl(230, 38%, 46%);
  --highlight-dark: hsl(230, 38%, 36%);
  --logo-width: 6em;
  --logo-offset: 1em;
  --main-column-width: 25em;
}

* {
  box-sizing: border-box;
  &::before,
  &::after {
    border-box: inherit;
  }
}

.app {
  position: relative;
  padding-left: .5em;
  max-width: 60em;
  background: hsl(220, 35%, 76%) 100% linear-gradient(hsl(252, 2%, 42%) 0%, hsl(0, 5%, 30%) 50%, hsl(220, 35%, 76%) 50%, hsl(220, 35%, 76%) 100%);
  background-size: auto 10em ;
  background-repeat: repeat-x;
  background-position: center top;
}

header {
  position: relative;
  height: 8em;
  grid-row: 1 / 3;
  grid-column: 2;
  background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/154571/bla.jpg");
  background-size: cover;
  background-position: right center;

  a {
    position: absolute;
    top: var(--logo-offset);
    left: var(--logo-offset);
    display: block;
    width: var(--logo-width);
  }
  
  img {
    display: block;
    max-width: 100%;
  }
}

nav {
  display: flex;
  padding: 1.5em var(--var-padding);
  grid-row: 1;
  grid-column: 1;
  background: #fff;
  
  a {
    display: block;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #333;
  }
  
  a + a {
    margin-left: 2em;
  }
  
  a:hover,
  a:focus {
    border-color: var(--highlight);
    border-width: 2px;
  }
  
  a[aria-current] {
    border-bottom: 2px solid var(--highlight);
  }
}

main {
  padding: var(--var-padding);
  grid-row: 2;
  grid-column: 1;
  background: #fff;
  
  h1 {
    margin-top: 0;
    font-weight: normal;

    span {
      display: block;
      color: var(--highlight);
      font-weight: bolder;
    }
    
    sub {
      font-size: .5em;
    }
  }
  
  a {
    color: var(--highlight);
    text-decoration: none;
    
    &::after {
      margin-left: 1.5em;
      content: '→';
      vertical-align: baseline;
    }
    
    &:hover,
    &:focus {
      color: var(--highlight-dark);
    }
    
    &:hover::after,
    &:focus::after {
      margin-left: 2em;
    }
  }
}

html {
  min-height: 100vh;
  font-family: sans-serif;
  line-height: 1.5;
  background: linear-gradient(45deg, hsl(30, 6%, 94%), hsl(20, 9%, 80%));
  background-repeat: no-repeat;
  background-size: cover;
}

body {
  margin: 0;
}

@media (min-width: 37.5em) {
  :root {
    --var-padding: 3em;
  }
  
  body {
    margin: 1em;
  }

  .app {
    display: grid;
    margin: 3em auto;
    grid-template-rows: 5em auto;
    grid-template-columns: 1.4fr 1fr;
    padding-left: 2em;
    background-size: auto;
    
    &::after {
      position: absolute;
      right: 1em;
      left: 1em;
      bottom: 0;
      z-index: -1;
      width: 95%;
      height: 200px;
      content: '';
      box-shadow: 0 0 5em hsl(22, 23%, 40%);
    }
  }
  
  header {
    height: auto;
    
    a {
      right: var(--logo-offset);
      left: auto;
    }
  }
  
  nav {
    justify-content: space-between;
  }
  
  main {
    min-width: var(--main-column-width);
  }
}
              
            
!

JS

              
                // https://dribbble.com/shots/3863348-Product-Web-Design
              
            
!
999px

Console