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

              
                <body>
  <section id="main">
    <!--Navigation-->
    <nav>
      <div class="logo">
        <a href="#">LOGO</a>
      </div>
      <input class="menu-btn" type="checkbox" id="menu-btn" />
      <label class="menu-icon" for="menu-btn">
        <span class="nav-icon"></span>
      </label>
      <!--Navigation-->
      <ul class="menu">
        <li><a href="#main">Home</a></li>
        <li><a href="#services">Services</a></li>
        <li><a href="#about">About</a></li>
        <li><a href="#contact">Contact</a></li>
      </ul>
    </nav>

    <div class="content">
      <h1>Striped Background</h1>
      <p>With repeating-linear-gradient</p>
    </div>

  </section>
</body>
              
            
!

CSS

              
                @charset "utf=8";
@import url("https://fonts.googleapis.com/css2?family=Asap&family=Roboto:ital,wght@0,500;0,900;1,500&display=swap");

body {
  margin: 0px;
  padding: 0px;
  font-family: "Asap", sans-serif;
}
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}
ul {
  list-style: none;
}
a {
  text-decoration: none;
}
nav {
  position: fixed;
  width: 100%;
  display: inline-flex;
  justify-content: space-around;
  align-items: center;
  height: 60px;
  padding: 0px 5%;
  z-index: 1;
  backdrop-filter: blur(5px);
  background-color: rgba(255, 255, 255, 0.1);
}
.logo a {
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.5px;
  color: #333;
}
nav ul {
  display: flex;
}
nav ul li a {
  height: 40px;
  line-height: 43px;
  margin: 10px;
  padding: 0px 30px;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  color: #301934;
  transition: 0.1s;
}
#main {
  width: 100%;
  min-height: 100vh;
  position: relative;
  background-image: repeating-linear-gradient(
    45deg,
    #553c9a,
    #553c9a 50px,
    #b393d3 50px,
    #b393d3 100px,
    #301934 100px,
    #301934 150px
  );
  background-size: cover;
  background-attachment: fixed;
}
.content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  border-radius: 5px;
  backdrop-filter: blur(5px);
  background-color: rgba(255, 255, 255, 0.1);
}
.content h1 {
  font-size: 3rem;
  font-weight: 600;
  color: #301934;
}
.content p {
  font-size: 2rem;
  color: #301934;
}
nav .menu-btn {
  display: none;
}
@media (max-width: 900px) {
  nav {
    justify-content: space-between;
    height: 65px;
    padding: 0px 30px;
  }
  .logo img {
    height: 35px;
  }
  .menu {
    display: none;
    position: absolute;
    top: 65px;
    left: 0px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    padding: 0px;
    margin: 0px;
  }
  .menu li {
    width: 100%;
  }
  nav .menu li a {
    width: 100%;
    height: 40px;
    justify-content: center;
    align-items: center;
    margin: 0px;
    padding: 25px;
    border: 1px solid rgba(38, 38, 38, 0.03);
  }
  nav .menu-icon {
    cursor: pointer;
    float: right;
    padding: 28px 20px;
    position: relative;
    user-select: none;
  }
  nav .menu-icon .nav-icon {
    display: block;
    height: 2px;
    position: relative;
    transition: background 0.2s ease-out;
    width: 18px;
  }
  nav .menu-icon .nav-icon::before,
  nav .menu-icon .nav-icon::after {
    content: "";
    display: block;
    height: 100%;
    position: absolute;
    transition: all ease-out 0.2s;
    width: 100%;
  }
  nav .menu-icon .nav-icon:before {
    top: 5px;
  }
  nav .menu-icon,
  .nav-icon:after {
    top: -5px;
  }
  nav .menu-btn:checked ~ .menu-icon .nav-icon {
    background: transparent;
  }
  nav .menu-btn:checked ~ .menu-icon .nav-icon:before {
    transform: rotate(-45deg);
    top: 0;
  }
  nav .menu-btn:checked ~ .menu-icon .nav-icon:after {
    transform: rotate(45deg);
    top: 0;
  }
  nav .menu-btn {
    display: none;
  }
  nav .menu-btn:checked ~ .menu {
    display: block;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console