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 class="align">

  <nav class="navigation">
    <ul class="navigation__list navigation__list--inline">
      <li>
        <a href="#">
          <svg class="icon icon--2x">
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#user" />
          </svg>
          <span class="invisible">Profile</span>
        </a>

        <ul class="navigation__list navigation__list--inline navigation__dropdown navigation__dropdown--right">

          <li>
            <a href="#" class="tooltip">
              <svg class="icon icon--2x">
                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#facebook" />
              </svg>
              <span class="tooltip__body tooltip__body--top">Facebook</span>
            </a>
          </li>

          <li>
            <a href="#" class="tooltip">
              <svg class="icon icon--2x">
                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#twitter" />
              </svg>
              <span class="tooltip__body tooltip__body--top">Twitter</span>
            </a>
          </li>

          <li>
            <a href="#" class="tooltip">
              <svg class="icon icon--2x">
                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#google-plus" />
              </svg>
              <span class="tooltip__body tooltip__body--top">Google+</span>
            </a>
          </li>

          <li>
            <a href="#" class="tooltip">
              <svg class="icon icon--2x">
                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#github" />
              </svg>
              <span class="tooltip__body tooltip__body--top">Github</span>
            </a>
          </li>

        </ul>
      </li>
    </ul>
  </nav>

  <svg xmlns="http://www.w3.org/2000/svg" class="icons">
    <symbol id="facebook" viewBox="0 0 1792 1792">
      <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z" fill="#fff" />
    </symbol>
    <symbol id="github" viewBox="0 0 1792 1792">
      <path d="M896 128q209 0 385.5 103T1561 510.5 1664 896q0 251-146.5 451.5T1139 1625q-27 5-40-7t-13-30q0-3 .5-76.5t.5-134.5q0-97-52-142 57-6 102.5-18t94-39 81-66.5 53-105T1386 856q0-119-79-206 37-91-8-204-28-9-81 11t-92 44l-38 24q-93-26-192-26t-192 26q-16-11-42.5-27T578 459.5 493 446q-45 113-8 204-79 87-79 206 0 85 20.5 150t52.5 105 80.5 67 94 39 102.5 18q-39 36-49 103-21 10-45 15t-57 5-65.5-21.5T484 1274q-19-32-48.5-52t-49.5-24l-20-3q-21 0-29 4.5t-5 11.5 9 14 13 12l7 5q22 10 43.5 38t31.5 51l10 23q13 38 44 61.5t67 30 69.5 7 55.5-3.5l23-4q0 38 .5 88.5t.5 54.5q0 18-13 30t-40 7q-232-77-378.5-277.5T128 896q0-209 103-385.5T510.5 231 896 128zM419 1231q3-7-7-12-10-3-13 2-3 7 7 12 9 6 13-2zm31 34q7-5-2-16-10-9-16-3-7 5 2 16 10 10 16 3zm30 45q9-7 0-19-8-13-17-6-9 5 0 18t17 7zm42 42q8-8-4-19-12-12-20-3-9 8 4 19 12 12 20 3zm57 25q3-11-13-16-15-4-19 7t13 15q15 6 19-6zm63 5q0-13-17-11-16 0-16 11 0 13 17 11 16 0 16-11zm58-10q-2-11-18-9-16 3-14 15t18 8 14-14z" fill="#fff" />
    </symbol>
    <symbol id="google-plus" viewBox="0 0 2304 1792">
      <path d="M1437 913q0 208-87 370.5t-248 254-369 91.5q-149 0-285-58t-234-156-156-234T0 896t58-285 156-234 234-156 285-58q286 0 491 192l-199 191Q908 433 733 433q-123 0-227.5 62T340 663.5 279 896t61 232.5T505.5 1297t227.5 62q83 0 152.5-23t114.5-57.5 78.5-78.5 49-83 21.5-74H733V791h692q12 63 12 122zm867-122v210h-209v209h-210v-209h-209V791h209V582h210v209h209z" fill="#fff" />
    </symbol>
    <symbol id="twitter" viewBox="0 0 1792 1792">
      <path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z" fill="#fff" />
    </symbol>
    <symbol id="user" viewBox="0 0 1792 1792">
      <path d="M1536 1399q0 109-62.5 187t-150.5 78H469q-88 0-150.5-78T256 1399q0-85 8.5-160.5t31.5-152 58.5-131 94-89T583 832q131 128 313 128t313-128q76 0 134.5 34.5t94 89 58.5 131 31.5 152 8.5 160.5zm-256-887q0 159-112.5 271.5T896 896 624.5 783.5 512 512t112.5-271.5T896 128t271.5 112.5T1280 512z" fill="#fff" />
    </symbol>
  </svg>

</body>
              
            
!

CSS

              
                @use postcss-preset-env {
  stage: 0;
}

/* helpers/accessibility.css */

.invisible {
  left: -999px;
  overflow: hidden;
  position: absolute;
  top: -999px;
}

/* helpers/align.css */

.align {
  display: grid;
  place-items: center;
}

/* layout/base.css */

:root {
  --html-font-size: 100%;

  --body-background-color: #434240;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  font-size: var(--html-font-size);
}

body {
  background-color: var(--body-background-color);
  font-family: sans-serif;
  line-height: 1.5;
  margin: 0;
  min-block-size: 100vh;
}

/* modules/anchor.css */

a {
  outline: 0;
}

/* modules/icon.css */

:root {
  --icon-fill-color: #535152;
}

.icons {
  display: none;
}

.icon {
  display: inline-block;
  fill: var(--icon-fill-color);
  font-size: 1rem;
  height: 1em;
  vertical-align: middle;
  width: 1em;
}

.icon--2x {
  font-size: 2rem;
}

/* modules/image.css */

svg {
  height: auto;
  max-width: 100%;
  vertical-align: middle;
}

/* modules/navigation.css */

:root {
  --navigation-background-color: #f0f6ff;
  --navigation-border-radius: 0.25rem;

  --navigation-anchor-padding: 1.5rem;
  --navigation-anchor-text-decoration: none;
}

.navigation {
  background-color: #ff6462;
  color: #535152;
}

.navigation__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.navigation li {
  flex-shrink: 0;
  position: relative;
}

.navigation a {
  display: block;
  height: 80px;
  padding: 1.5rem;
  position: relative;
  text-decoration: none;
  width: 80px;
}

.navigation__dropdown {
  background-color: #535152;
  opacity: 0;
  position: absolute;
  transition: opacity 0.3s;
  visibility: hidden;
}

.navigation__dropdown--right {
  left: 100%;
  top: 0;
}

.navigation li:hover > .navigation__dropdown {
  opacity: 1;
  visibility: visible;
}

.navigation__list--inline {
  display: flex;
}

/* modules/tooltip.css */

.tooltip {
  position: relative;
}

.tooltip__body {
  background-color: #ff6462;
  border-radius: 0.33em;
  color: #373634;
  display: inline-block;
  font-size: 0.875em;
  opacity: 0;
  padding: 0.25em 0.75em;
  position: absolute;
  transition: opacity 0.5s, transform 0.3s;
  visibility: hidden;
}

.tooltip:focus .tooltip__body,
.tooltip:hover .tooltip__body {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.tooltip__body--top {
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, 100%);
}

.tooltip__body--top::after {
  border-left: 0.5em solid transparent;
  border-right: 0.5em solid transparent;
  border-top: 0.5em solid #ff6462;
  content: '';
  height: 0;
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
  width: 0;
}

              
            
!

JS

              
                
              
            
!
999px

Console