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

              
                <header>
  <h1 class="logo">Welcome!</h1>
  <nav>
    <ul class="nav-list">
      <li>
        <a href="#art-1">Article 1</a>
      </li>
      <li>
        <a href="#art-2">Article 2</a>
      </li>
      <li>
        <a href="#art-3">Article 3</a>
      </li>
      <li>
        <a href="#art-4">Article 4</a>
      </li>
      <li>
        <a href="#art-5">Article 5</a>
      </li>
      <li>
        <a href="#art-6">Article 6</a>
      </li>
    </ul>
  </nav>
</header>

<section class="main">
  <h1>Scroll and look at scrollbar</h1>
  <article id="art-1" class="first-article article">
    <h2>Article 1</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae tempus quam pellentesque nec nam. Nibh mauris cursus mattis molestie a. Sed id semper risus in hendrerit gravida rutrum. Urna condimentum mattis pellentesque id nibh tortor id. Lobortis scelerisque fermentum dui faucibus in ornare. Etiam erat velit scelerisque in dictum non. Sit amet tellus cras adipiscing enim eu turpis. Felis eget nunc lobortis mattis aliquam faucibus purus in massa. Tellus in hac habitasse platea dictumst vestibulum. Congue nisi vitae suscipit tellus mauris a. Augue mauris augue neque gravida. Purus sit amet luctus venenatis. Molestie at elementum eu facilisis sed. Urna condimentum mattis pellentesque id nibh.</p>
  </article>
  <article id="art-2" class="second-article article">
    <h2>Article 2</h2>
    <p>Ornare massa eget egestas purus viverra accumsan in nisl nisi. Tristique sollicitudin nibh sit amet commodo nulla. Tellus id interdum velit laoreet id donec. Sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. Massa tempor nec feugiat nisl pretium fusce id. Augue lacus viverra vitae congue eu consequat ac felis donec. Bibendum est ultricies integer quis auctor elit sed. Faucibus purus in massa tempor nec. Integer malesuada nunc vel risus commodo viverra maecenas accumsan. Sem integer vitae justo eget magna fermentum iaculis eu non. Diam sit amet nisl suscipit. Eget nullam non nisi est sit amet. Sed adipiscing diam donec adipiscing tristique risus. Nec feugiat in fermentum posuere urna nec tincidunt.</p>
  </article>
  <article id="art-3" class="third-article article">
    <h2>Article 3</h2>
    <p>Vel quam elementum pulvinar etiam non quam lacus suspendisse. Nisl nisi scelerisque eu ultrices vitae auctor eu. Nisi lacus sed viverra tellus in hac. Placerat in egestas erat imperdiet sed euismod nisi. Orci a scelerisque purus semper eget duis at tellus at. Neque vitae tempus quam pellentesque nec nam. Orci nulla pellentesque dignissim enim sit. Leo a diam sollicitudin tempor. Facilisis magna etiam tempor orci eu. Libero justo laoreet sit amet cursus sit amet. Ultricies integer quis auctor elit sed vulputate mi sit amet. Purus gravida quis blandit turpis cursus in hac habitasse. A diam sollicitudin tempor id eu. Non nisi est sit amet facilisis magna etiam tempor.</p>
  </article>
  <article id="art-4" class="fourth-article article">
    <h2>Article 4</h2>
    <p>Vestibulum lectus mauris ultrices eros in cursus turpis. Habitant morbi tristique senectus et netus. Amet volutpat consequat mauris nunc congue nisi vitae suscipit tellus. Vel turpis nunc eget lorem dolor sed viverra ipsum nunc. Iaculis urna id volutpat lacus laoreet non curabitur gravida arcu. Viverra maecenas accumsan lacus vel. Turpis egestas integer eget aliquet nibh praesent. Ut porttitor leo a diam. Placerat orci nulla pellentesque dignissim enim. In massa tempor nec feugiat nisl pretium fusce id velit. Felis imperdiet proin fermentum leo vel orci. Quam id leo in vitae turpis massa. Convallis convallis tellus id interdum velit laoreet id donec. Id neque aliquam vestibulum morbi. Gravida dictum fusce ut placerat. Maecenas ultricies mi eget mauris pharetra et. Massa placerat duis ultricies lacus sed turpis tincidunt id aliquet. Praesent tristique magna sit amet purus gravida quis blandit. Eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar. Sagittis purus sit amet volutpat consequat mauris nunc congue.</p>
  </article>
  <article id="art-5" class="fifth-article article">
    <h2>Article 5</h2>
    <p>Vestibulum lectus mauris ultrices eros in cursus turpis. Habitant morbi tristique senectus et netus. Amet volutpat consequat mauris nunc congue nisi vitae suscipit tellus. Vel turpis nunc eget lorem dolor sed viverra ipsum nunc. Iaculis urna id volutpat lacus laoreet non curabitur gravida arcu. Viverra maecenas accumsan lacus vel. Turpis egestas integer eget aliquet nibh praesent. Ut porttitor leo a diam. Placerat orci nulla pellentesque dignissim enim. In massa tempor nec feugiat nisl pretium fusce id velit. Felis imperdiet proin fermentum leo vel orci. Quam id leo in vitae turpis massa. Convallis convallis tellus id interdum velit laoreet id donec. Id neque aliquam vestibulum morbi. Gravida dictum fusce ut placerat. Maecenas ultricies mi eget mauris pharetra et. Massa placerat duis ultricies lacus sed turpis tincidunt id aliquet. Praesent tristique magna sit amet purus gravida quis blandit. Eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar. Sagittis purus sit amet volutpat consequat mauris nunc congue.</p>
  </article>
  <article id="art-6" class="sixth-article article">
    <h2>Article 6</h2>
    <p>Vestibulum lectus mauris ultrices eros in cursus turpis. Habitant morbi tristique senectus et netus. Amet volutpat consequat mauris nunc congue nisi vitae suscipit tellus. Vel turpis nunc eget lorem dolor sed viverra ipsum nunc. Iaculis urna id volutpat lacus laoreet non curabitur gravida arcu. Viverra maecenas accumsan lacus vel. Turpis egestas integer eget aliquet nibh praesent. Ut porttitor leo a diam. Placerat orci nulla pellentesque dignissim enim. In massa tempor nec feugiat nisl pretium fusce id velit. Felis imperdiet proin fermentum leo vel orci. Quam id leo in vitae turpis massa. Convallis convallis tellus id interdum velit laoreet id donec. Id neque aliquam vestibulum morbi. Gravida dictum fusce ut placerat. Maecenas ultricies mi eget mauris pharetra et. Massa placerat duis ultricies lacus sed turpis tincidunt id aliquet. Praesent tristique magna sit amet purus gravida quis blandit. Eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar. Sagittis purus sit amet volutpat consequat mauris nunc congue.</p>
  </article>
</section>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pacifico&display=swap');

$gray: #efefef;
$dark-gray: #817f82;
$green: #34d1bf;
$black: #070707;

// Custom scrollbar

// For Firefox you write this here

html {
  scrollbar-width: thin; // normal or you can put you own dimension (the best unit for scrollbar is wv)
  scrollbar-color: $green $black; // first color is for thumb, second one is for track
}

// For other browsers you write this here

html::-webkit-scrollbar {
  width: 3vw;
}

html::-webkit-scrollbar-thumb {
  background-color: $green;
}

html::-webkit-scrollbar-track {
  background-color: $black;
}

// General styles, nothing special

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

ul {
  list-style-type: none;
  
  li {
    margin-top: .5em;
  }
  
  li + li {
    margin-left: .8em;
  }
}

a {
  color: $black;
  text-decoration: none;
  font-size: 18px;
  display: inline-block;
  transition: all 500ms ease-in-out;
  
  &:hover {
    transform: translateY(-5px);
    color: $green;
  }
}

header {
  
  max-width: 800px;
  margin: 0 auto;
  padding: 1em 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  .nav-list {
    display: flex;
    margin-left: auto;
  }
  
  .logo {
  font-family: "Pacifico", cursive;
  color: $green;
}
  
}

body {
  background: $gray;
  font-family: 'Nunito', sans-serif;
  color: $black;
  
  .main {
    max-width: 800px;
    margin: 4rem auto;
    
    h1 {
      font-size: 30px;
      position: relative;
      
      &::after {
        position: absolute;
        content: '';
        background: $green;
        width: 120px;
        height: 5px;
        border-radius: 200px;
        bottom: 0px;
        left: 255px;
      }
    }
    
    .article {
      margin-top: 3em;
      background: $dark-gray;
      padding: 2em;
      color: $gray;
      border-radius: 50px 0px;
      box-shadow: 5px 10px 30px rgba(0 0 0 / .33);
      
      p {
        margin-top: 1em;
      }
    }
  }
}

@media (max-width: 600px){
  header, .main {
    width: 95%; 
    margin: 0 auto;
  }
  
  h1 {
    font-size: 22px;
  }
  
  .article {
    h2 {
    font-size: 18px;
    }
    
    p {
      font-size: 14px;
    }
  }
  
  a {
    font-size: 12px;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console