Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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>
  <ul class="main-list">
    <li>каталог</li>
    <li>презентация</li>
    <li>контакты</li>
  </ul>
</nav>
<main>
  <section>
    <h1>заголовок</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sit amet nisi vitae enim facilisis maximus. Quisque lectus dolor, suscipit vitae laoreet sed, semper et augue. Vestibulum tincidunt ante sit amet ligula maximus, non posuere dui tempor. Proin ac elementum erat. Donec ullamcorper nisl in nulla finibus, sed tempor massa suscipit. Nulla rhoncus tempus lectus, a faucibus tellus faucibus dignissim. Donec id blandit lacus, et sollicitudin quam. Nulla finibus faucibus urna. Nullam eget congue sapien, vel ultricies purus.</p>
    <p>Aenean tristique gravida diam ut euismod. Etiam interdum gravida sem sit amet semper. Pellentesque at fermentum tortor, tincidunt rhoncus erat. Donec vitae volutpat leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam urna diam, gravida non mattis vel, fermentum vitae mauris. Fusce ligula odio, dignissim nec leo eget, finibus pretium dui. Proin suscipit, sem a tristique sodales, nibh dolor sagittis justo, vitae faucibus leo risus vitae sapien. Duis nisi risus, lobortis a dui vitae, eleifend bibendum arcu. Nam imperdiet mattis turpis, sit amet venenatis ligula tincidunt nec. Aenean sed scelerisque turpis. Curabitur id ligula sed lectus tincidunt blandit. Phasellus pretium neque lorem, vitae placerat dui interdum nec. Proin ac velit accumsan, ultrices massa eget, elementum ligula. Sed efficitur nisi velit, non blandit sapien porta a. Pellentesque non varius turpis, nec porta velit.</p>
    <p>In vehicula, mauris id consectetur lobortis, nibh nisl tempus quam, varius interdum ligula ante vel arcu. Phasellus ut felis eget leo pharetra ultricies non eleifend massa. In pulvinar ut risus at placerat. Duis tempus nisl id aliquet finibus. Donec massa urna, suscipit sit amet tellus sed, commodo venenatis mi. Cras eu nisi arcu. Sed nec libero elit. Mauris elementum sed sem at egestas. Ut gravida condimentum ultricies. Phasellus sollicitudin condimentum enim in venenatis. Nulla aliquet, nisi mattis luctus fermentum, odio mauris fringilla quam, cursus sollicitudin diam lacus ac libero. Nam sodales, ante varius rhoncus interdum, nibh ante fringilla nibh, a volutpat odio tellus sed massa. Vivamus sagittis mauris eu turpis commodo, non cursus sapien cursus. Quisque vel consequat lacus.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sit amet nisi vitae enim facilisis maximus. Quisque lectus dolor, suscipit vitae laoreet sed, semper et augue. Vestibulum tincidunt ante sit amet ligula maximus, non posuere dui tempor. Proin ac elementum erat. Donec ullamcorper nisl in nulla finibus, sed tempor massa suscipit. Nulla rhoncus tempus lectus, a faucibus tellus faucibus dignissim. Donec id blandit lacus, et sollicitudin quam. Nulla finibus faucibus urna. Nullam eget congue sapien, vel ultricies purus.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sit amet nisi vitae enim facilisis maximus. Quisque lectus dolor, suscipit vitae laoreet sed, semper et augue. Vestibulum tincidunt ante sit amet ligula maximus, non posuere dui tempor. Proin ac elementum erat. Donec ullamcorper nisl in nulla finibus, sed tempor massa suscipit. Nulla rhoncus tempus lectus, a faucibus tellus faucibus dignissim. Donec id blandit lacus, et sollicitudin quam. Nulla finibus faucibus urna. Nullam eget congue sapien, vel ultricies purus.</p>
  </section>
</main>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
}

nav {
  margin-bottom: 10px;
  height: 80px;
}

ul {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: inherit;
  background-color: tan;
  list-style: none;
}

section,
section p {
  margin: 20px;
}

.fixed {
  position: fixed;
  width: 100%;
}
              
            
!

JS

              
                var fixed = document.querySelector(".main-list")

window.addEventListener("wheel", function (evt) {
    if (event.deltaY > 0) {
        fixed.classList.remove("fixed");
    } else {
        fixed.classList.add("fixed");
    }
}, false);
              
            
!
999px

Console