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

              
                <!DOCTYPE html>
<html>
 <head>
   <title>Sticky Position Header</title>
</head>
<body>
  <div class="header-large"></div>
  <div class="main-nav">
    <div>HOME</div>
    <div>ABOUT</div>
    <div>CONTACT</div>
  </div>
  <p class="content">
    Lorem ipsum dolor, sit amet consectetur adipisicing elit. Modi doloremque ducimus eaque mollitia dolore nesciunt deleniti! Incidunt et, cupiditate ducimus aliquam fugiat magnam. Eligendi impedit vitae incidunt placeat ullam tempora? Asperiores nam amet accusantium distinctio cum possimus excepturi sed consequuntur tempora dignissimos cumque soluta porro vero recusandae nesciunt, nulla exercitationem obcaecati unde similique velit corrupti fugit earum architecto eligendi. Recusandae reiciendis exercitationem tempora impedit ipsum laudantium. Molestiae sed exercitationem facilis sunt autem maxime quidem doloribus numquam? Repellat praesentium nesciunt porro, qui ducimus maxime harum suscipit accusamus ex velit, facere assumenda officiis. Cupiditate odio reiciendis ipsum eligendi accusantium pariatur! Illo, quis error, voluptatibus dolorum nesciunt laborum rerum fuga dolores voluptate nulla minus cupiditate incidunt expedita aspernatur fugiat quo. Fugit eius perspiciatis sequi. Error tempora accusantium amet. Iste amet beatae, doloremque dolor ratione ut placeat illo illum distinctio quibusdam unde? Temporibus repellendus nam aspernatur eum asperiores quibusdam sit, enim ex nesciunt placeat labore ducimus autem! Soluta fugit alias et temporibus nulla aperiam tempore, repellendus ullam animi ea id esse delectus ab quae officia harum voluptatum quaerat corrupti impedit distinctio, est facilis laborum atque! Recusandae ratione provident dolor, voluptatem cumque repudiandae, consequuntur aut dolore magni commodi vitae totam. Nam, in atque. Reprehenderit sapiente cum exercitationem molestias temporibus quia cupiditate nisi a. Maxime, eius deserunt. Harum nisi quaerat quae, magnam natus, sequi ratione voluptatibus esse alias numquam tenetur eum recusandae praesentium temporibus error, explicabo facilis deleniti impedit unde dolore nesciunt modi ab perspiciatis. Deserunt reiciendis optio cum ab beatae distinctio odit corporis rem delectus, est quos facere laborum! Repudiandae earum voluptatibus nihil rem illo cum neque iste officia eius, perspiciatis hic. Fuga excepturi molestiae harum ipsam veniam eum ipsum cum eius sed a modi illum beatae maxime commodi voluptate, quae dolor quod quasi cupiditate iure labore repellat voluptatum dolore. Sed odio eius officiis iure.
  </p>
</body>
 
      
      
     
      
      
      
      
      
      
      
      
      
      
      <!-- Side Links Only -->
      <div class="side-links">
        <a href="https://youtu.be/7Hl2qa7-Bfc" target="_blank" class="side-link side-link-youtube">
          <i class="fab fa-youtube-square side-link-icon"></i>
          <span class="side-link-text">View Tutorial</span>
        </a>
        <a href="https://github.com/WebDevSimplified" target="_blank" class="side-link side-link-github side-link-icon">
          <i class="fab fa-github-square"></i>
          <span class="side-link-text">View GitHub</span>
        </a>
        <a href="https://twitter.com/DevSimplified" target="_blank" class="side-link side-link-twitter">
          <i class="fab fa-twitter-square side-link-icon"></i>
          <span class="side-link-text">View Twitter</span>
        </a>
      </div>
    </body>
</html>
              
            
!

CSS

              
                .main-nav {
  position: sticky;
  top: 0;
}














/* Background Styles Only */

@import url('https://fonts.googleapis.com/css?family=Raleway');

* {
  font-family: Raleway;
}

body {
  background-color: #DFDFDF;
  margin: 0;
  padding: 0;
  height: 100%;
}

html {
  height: 300%;
}

.content {
  padding: 10px;
}

.header-large {
  color: #00FF6C;
  height: 400px;
  background-size: cover;
  background-position: center;
  background-image: url("https://source.unsplash.com/g5Uh7nP60FA");
  display: flex;
  align-items: flex-start;
}

.main-nav {
  display: flex;
  width: 100%;
  justify-content: space-around;
  background-color: rgb(51, 51, 51);
  padding: 5px;
  color: #00FF6C;
}

.list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}

.list-content {
  padding: 10px 20px;
}

.list-header {
  background-color: #333;
  color: #00FF6C;
  padding: 10px;
  font-weight: bold;
}

.side-links {
  position: absolute;
  top: 15px;
  right: 15px;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-bottom: 10px;
  color: white;
  width: 180px;
  padding: 10px 0;
  border-radius: 10px;
}

.side-link-youtube {
  background-color: red;
}

.side-link-twitter {
  background-color: #1DA1F2;
}

.side-link-github {
  background-color: #6e5494;
}

.side-link-text {
  margin-left: 10px;
  font-size: 18px;
}

.side-link-icon {
  color: white;
  font-size: 30px;
}
              
            
!

JS

              
                
              
            
!
999px

Console