cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

              <div class="container">
  <header role="banner">
    <h1>Brand Name</h1>
        <li><a href="#main">Home</a></li>
        <li><a href="/about">About</a></li>
        <li><a href="/products">Products</a></li> 
        <li><a href="/login">Login</a></li>
  <main id="main">
    <h2>Content goes here</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consectetur deserunt, suscipit velit itaque vitae necessitatibus, impedit pariatur eos. Pariatur beatae sed repellendus iusto doloribus quidem asperiores quia exercitationem sint dicta!</p>
              /* Defuault styles:
width: narrow,
orientation: portrait, 
update: slow,
scan: interlace,
monochrome: 1,
pointer: coarse, 
hover: none

/* Positions the navbar at the bottom for easy thumb access on small devices with portrait orientation */ 
h1, nav{
  position: fixed;
  left: 0;
  right: 0; 

/* Creates large touch areas for finguers (coarse) */
li a {
  min-height: 4em;

/* Moves the main area to accomodate fixed header and navbar */
main {
  padding: 1em;
  padding-bottom: 5em;
  padding-top: 5em;

/* Mobile first: Accomodates the brand name on the left and the navigation on the right and it wraps without the need of width media queries */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;

/* Center aligns the brand name */
h1 {
  display: flex;
  min-height: 2.5em;
  align-items: center;
  flex: 1 0 auto;
  padding-left: 1em;
  padding-right: 1em;

/* Flex items to make them streach */
nav {
  bottom: 0;
  display: flex;
  flex: 1 0 auto;

ul, li, li a {
 display: flex;
 flex: 1;

li a {
  flex: 1;
  align-items: center;
  justify-content: center;
  padding-left: 1em;
  padding-right: 1em;
  border-left: 1px solid black;

li:first-child a {
  border: none;

/* General make up: colors, fonts, etc */
html, body, .container { box-size: border-box; height: 100vh; }
body { font-family: sans-serif; line-height: 1.5; }
header { background: #393f44; border-top: 4px solid #00a8e1; color: white; }
nav { background: #292e34; }
h1 { background: #030303; font-weight: bold; }
li a { color: #ccc; }
li a:hover { background: #393f44; color: white }
h2, p { margin-bottom: 1em; }
h2 {font-weight: 700; }
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................