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

              
                <nav>
<aside>
  <figure>
    <img src="https://s26.postimg.cc/fo229bi09/avatar.jpg" alt="avatar" title="avatar" id="avatar"/>
    <figcaption>John Doe</figcaption>
  </figure>
  <div class="hamburger" id="hamburger">
    <span class="bar"></span>
    <span class="bar"></span>
    <span class="bar"></span>
  </div>
</aside>
    <ul>
      <li><a href="#home" class="scroll">Home</a></li>
      <li><a href="#about" class="scroll">About</a></li>
      <li><a href="#work" class="scroll">Portfolio</a></li>
      <li><a href="#" class="scroll blog">Blog</a></li>
      <li><a href="#" class="scroll">Contact</a></li>
    </ul>
</nav>
<main id="home">
  <div class="caption">
    <h1>Hi, I'm John.</h1>
    <h1>I'm a designer.</h1> 
  </div>
  <p class="home-para">I make websites, create logos and maintain a design blog.</p>
  <a class="cta button scroll" href="#work">see my portfolio</a>
</main>
<main id="about">
  <img src="https://s26.postimg.cc/fo229bi09/avatar.jpg" alt="image" title="image" class="about-photo"/>
<section class="about-info">
  <h1 class="about-head">John Doe</h1>
  <div class="divider"></div>
  <p class="about-para">I'm a human being. I live in North America. I eat pizzas and burritos. I sleep in a bed from Ikea. I'm a human being. I live in North America. I eat pizzas and burritos. I sleep in a bed from Ikea.</p>
</section>
</main>
<main id="work" class="work">
    <div class="work-text">
      <h1>Here's what I've done</h1>   
        <p>Here are a couple of projects on which I have worked. Check them out!</p>
    </div>
    <div class="work-pictures">
    <figure>
        <img src='https://images.unsplash.com/photo-1464206439213-a4dac837396b?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ&s=67e90945b9702c9c057669176d3abb8a' alt=''>
        <figcaption class = "work-overlay">Item One</figcaption>
    </figure>
    <figure>
        <img src='https://images.unsplash.com/photo-1448229583641-6739e82237d4?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ&s=dc93c949a585900c0156087e3bc42160' alt=''>
        <figcaption class = "work-overlay">Item Two</figcaption>
    </figure>
    <figure>
        <img src='https://images.unsplash.com/photo-1471477259257-daf4d283c9c8?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ&s=9740c3266c6a7d5320e746eb40439f81' alt=''>
        <figcaption class = "work-overlay">Item Three</figcaption>
    </figure>
    <figure>
        <img src='https://images.unsplash.com/photo-1513893309566-890d7161b0c3?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ&s=d6d63774c292ecf8034b6f83dc3e74cc' alt=''>
        <figcaption class = "work-overlay">Item Four</figcaption>
    </figure>
    </div>
</main>
<!--
<main id="contact">
  <div class="about-icons">
    <i class="fab fa-facebook-f fa-2x" data-fa-transform="shrink-3.5 down-1.6 right-1.25" data-fa-mask="fas fa-circle"></i>
    <i class="fab fa-twitter fa-2x" data-fa-transform="shrink-6" data-fa-mask="fas fa-circle"></i>
    <i class="fab fa-google-plus fa-2x"></i>
    <i class="fab fa-github fa-2x"></i>
    <i class="fab fa-codepen fa-2x" data-fa-transform="shrink-6" data-fa-mask="fas fa-circle"></i>
  </div>
</main>-->
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  font-family: 'montserrat', sans-serif;
  box-sizing: border-box;
  overflow: none;
}

body, html {
  background: linear-gradient(to bottom, #9EB8E5, #5F82C0) no-repeat;
  background-attachment: fixed;
}

nav {
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 2;
}

aside {
  background-color: #bfbfbf;
  box-shadow: 0 1px 10px;
  padding: 1em;
  display: grid;
  grid-template-columns: auto 40px;
  z-index: 1;
}

#avatar {
  width: 50px;
  border-radius: 50%;
  display: none;
}

figcaption {
  color: #fff; 
  font-size: 1.4em;
  font-weight: bold;
}

.hamburger{
  cursor: pointer;
  width: 30px;
  height: 30px;
  z-index: 3;
}

.bar {
  display: block;
  width: 30px;
  height: 5px;
  margin: 5px 0;
  background: white;
  border-radius: 15px;
  transition: 0.2s ease-in;
}
.responsive :first-child {
  transform: rotate(45deg) translate(7px, 7px);
}
.responsive :nth-child(2) {opacity: 0;}
.responsive :last-child {
  transform: rotate(-45deg) translate(7px, -7px);
}

ul {
  background-color: #fff;
  padding: .5em 0;
  position: relative;
  left: -100%;
  z-inex: 0;
  transition: left .7s ease-out;
  -moz-transition: left .7s ease-out;
  -webkit-transition: left .7s ease-out;
}

.active {
  left: 0;
  width: 100%;
  transition: left .7s ease-out;
  -moz-transition: left .7s ease-out;
  -webkit-transition: left .7s ease-out;
}

ul {
  width: auto;
}

ul li {
  list-style-type: none;
  margin: 1em 0;
}
ul li a{
  text-decoration: none;
  color: #000;
  font-size: 1.3em;
  display: block;
  text-align: center;
}
main {
  background-color: #fff;
  margin: 2em;
  margin-top: 80px;
  height: 80vh;
  box-shadow: 3px 3px;
}
#home {  
  display: flex;
  flex-direction: column;
  /*height: auto;*/
}
.caption {
  text-align: center;
  padding-top: 3em;
  font-weight: bold;
  text-transform: uppercase;
  line-height: 1.3;
}
.home-para {
  padding: 1em;
  font-size: 1.5em;
  text-align: center;
}

.cta {
  background-color: #7F9ED5;
  border: 3px solid #7f9ed5;
  text-decoration: none;
  color: #fff;
  padding: 1em;
  border-radius: 8px;
  display: inline-block;
  margin: 2em auto;
  text-align: center;
}

.cta:hover {
  border: 3px solid #7F9ED5;
  background-color: #fff;
  color: #7F9ED5;
  font-weight: bold;
}

.about-photo {
  display: block;
  width: 20vw;
  border-radius: 50%;
  margin: 0 auto;
}
.about-info {
  width: 100%;
  margin: 0 auto;
}
.about-head {
  padding: 1.5em 0;
  text-align: center;
  font-size: 2em;
}

.divider {
  background-color: #7F9ED5;
  height: 5px;
  width: 90%;
  margin: auto;
}

.about-para {
  text-align: justify;
  font-size: 1em;
  margin: 2em .5em;
}
.work {
    padding: 2em 1em;
    height: auto;
}
.work-text{
  padding: 1em;
}
.work-text p {
    margin-top: 1em;
    line-height: 20pt;
    font-size: 1.25em;
}

.work-pictures {
  padding: 1.5em 1em;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
.work figure {
  position: relative;
  margin: 1em; 
  z-index: 0;
  overflow: hidden;

}
.work figure img {
    height: 100%;
    width: 100%;
}
.work-overlay{
  color: #000;
  background-color: #00000070;
  width: 100%;
  max-height: 0;
  position: absolute;
  top: 0;
  z-index: 3;
  bottom: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  color: white;
  transition: 1s ease-in-out;
}
.work figure:hover .work-overlay{
  bottom: 0;
  max-height: 100%;
}
/*
.contact-icons {
  margin: 1em auto;
  width: 80%;
  display: flex;
  justify-content: space-between;
}*/

@media only screen and (min-width: 768px) {
  nav {
    position: fixed;
    top: 0;
    width: 100vw;
    overflow: hidden;
  }
  #avatar {
    display: block;
    float: left;
  }
  figcaption {
    display: inline-block;
    margin: .5em 1em;
  }
  .hamburger {
    display: none;
  }
  ul {
    background-color: inherit;
    display: block;
    position: absolute;
    top: 0;
    left: auto;
    right: 0;
    right: 20px;
  }
  
  ul li {
    display: inline-block;
    height: 60px;
    margin: 0;
  }
  
  ul li a {
     color: #fff;
     padding: 1.4em 1em;
     margin: 0 -3px;
  }
  ul li a:hover {
    background-color: #7F9ED5;
    transition: ease-in-out .5s, ease in-out .5s;
  }
  
  #home {
    background: #fff url("https://s26.postimg.cc/mfshc6u55/image.png") no-repeat right bottom;
    background-size: 35%;
    margin-top: 100px;
  }
  
  .caption, .home-para {
   text-align: left;
   padding-left: 5%;
   margin: 1em 0;
   width: 50%;
  }
  .home-para {
    display: inline;
    margin-right: 5px;
  }
  .cta {
    margin-left: 5%;
    margin-top: 2em;
  }
  #about {
    display: grid;
    grid-template-columns: 60% 40%;
    overflow: hidden;
  }
  .about-photo {
    width: auto;
    display: inline;
    max-height: 80%;
    margin: 2em auto;
    border: 10px solid #7F9ED5;
    border-radius: 0;
  }
  .about-info {
    color: #fff;
    background-color: #7F9ED5;
    margin: 0 auto;
    width: 70%;
  }
  .about-head {
    text-align: center;
    padding: .5em 0;
    margin: .7em 1em;
  }
  .divider {
    background-color: #fff;
    height: 10px;
    width: 100%;
    padding: 0 .5em;
  }
  
  .about-para {
    padding: .5em 1em;
  }
  .work {
      padding: 2em 1em;
      height: auto;
  }
  .work-text{
    padding: 1em;
    margin-right: 10%;
    width: 40%;
    float: left;
  }
  .work-text h1 {
    margin-top: .5em;
  }
  .work-text p {
    margin-top: 3em;
  }
  .work-pictures {
    width: 50%;
    padding: 0;
    flex-flow: row wrap;
  }
  .work figure {
      width: 40%;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console