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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <html>
    <head>
        <title>#5 horizontal header with menu - flexbox</title>
        <link href="https://fonts.googleapis.com/css2?family=Jua&family=Roboto:wght@300&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="./assets/css/main.css">
    </head>
    <body>
        <header>
          <a href="#" title="Your Company" class="logo">
            <svg width="40" height="40" xmlns="http://www.w3.org/2000/svg">
              <defs>
                <linearGradient id="grad1" x1="0" y1="0" x2="1" y2="1">
                  <stop offset="20%" style="stop-color: rgb(251,176,64)" />
                  <stop offset="100%" style="stop-color: rgb(239,65,54)" />
                </linearGradient>
              </defs>
              <g>
                <ellipse cx="20" cy="20" rx="20" ry="20" fill="url(#grad1)" />
                <ellipse cx="20" cy="20" rx="10" ry="10" fill="#ffffff" />
              </g>
            </svg>
            Your Company
          </a>
          <nav>
            <ul>
              <li><a href="#" title="Menu item #1">Menu item #1</a></li>
              <li><a href="#" title="Menu item #2">Menu item #2</a></li>
              <li><a href="#" title="Menu item #3">Menu item #3</a></li>
              <li><a href="#" title="Menu item #4">Menu item #4</a></li>
            </ul>
          </nav>
      </header>
  </body>
</html>
                
              
            
!

CSS

              
                /* layout relevant styles */
html, body
    width: 100%
    height: 100%
    margin: 0
  
header
    display: grid
    grid-template-columns: 25% auto
  
    .logo svg
        display: block
        float: left
    nav
        margin: auto 0 auto auto
      
    nav ul
        display: grid
        margin: auto
        grid-template-columns: repeat(4, minmax(0, 1fr))
      
      
/* other styles */
header
    height: 40px
    padding: 50px
    line-height: 40px
    font-family: Roboto, sans-serif
  
    .logo
        font-size: 2rem
        color: #000
        text-decoration: none

        svg
            margin-right: 20px

        &:hover
            color: #666

    nav
        ul
            margin: 0
            padding: 0 20px
            list-style-type: none
            border: 1px solid #000
            border-radius: 20px
        
            li
                padding: 0 10px
                position: relative
          
                &:not(:last-child)::after
                    position: absolute
                    right: -3px
                    font-size: 1.5rem
                    content: "|"
          
            a
                display: inline-block
                height: 100%
                text-decoration: none
                color: #000
            
            &:hover a, &:hover li
                color: #999
            &:hover a:hover
                color: #000

a, a:hover, li::after
    transition: all 0.3s ease
              
            
!

JS

              
                
              
            
!
999px

Console