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

              
                pre.code
  | // HTML
  | div.nav-wrapper
  |   div.logo
  |   nav.navigation
  |   div.nav-btn
section
  header.header.nav1
    div.nav-wrapper
      div.logo
        a(href="#") LOGO
      nav.navigation
        ul.nav-list
          each i in [1,2,3,4]
            li.nav-item
              span.nav-link= `LINK${i}`
      div.nav-btn
        a.btn(href="#") Button
  pre.code
    | justify-content: space-between;

section
  header.header.nav2
    div.nav-wrapper
      div.logo
        a(href="#") LOGO
      nav.navigation
        ul.nav-list
          each i in [1,2,3,4]
            li.nav-item
              span.nav-link= `LINK${i}`
      div.nav-btn
        a.btn(href="#") Button
  pre.code
    | justify-content: flex-start;
    | .navigation {
    |   margin: 0 auto;
    | }

section
  header.header.nav3
    div.nav-wrapper
      div.logo
        a(href="#") LOGO
      nav.navigation
        ul.nav-list
          each i in [1,2,3,4]
            li.nav-item
              span.nav-link= `LINK${i}`
      div.nav-btn
        a.btn(href="#") Button
  pre.code
    | justify-content: flex-end;
    | .logo {
    |   margin-right: auto;
    | }

hr

pre.code
  | // HTML
  | div.nav-wrapper
  |   div.logo
  |   nav.navigation
  |     ul.nav-list
  |     div.nav-btn
section
  header.header.nav4
    div.nav-wrapper
      div.logo
        a(href="#") LOGO
      nav.navigation
        ul.nav-list
          each i in [1,2,3,4]
            li.nav-item
              span.nav-link= `LINK${i}`
        div.nav-btn
          a.btn(href="#") Button
  pre.code
    | justify-content: flex-start;
    | .navigation {
    |   display: flex;
    |   flex-flow: row nowrap;
    |   justify-content: center;
    |   width: 100%;
    | }
    | .navigation .nav-list {
    |   margin: 0 auto;
    | }

hr

pre.code
  | // HTML
  | div.nav-wrapper
  |   div.logo
  |   nav.navigation
  |     ul.nav-list
  |       li.nav-item
  |       li.nav-btn
section
  header.header.nav5
    div.nav-wrapper
      div.logo
        a(href="#") LOGO
      nav.navigation
        ul.nav-list
          each i in [1,2,3,4]
            li.nav-item
              span.nav-link= `LINK${i}`
          li.nav-btn
            a.btn(href="#") Button
  pre.code
    | justify-content: space-between;
    | .navigation {
    |   width: 100%;
    | }
    | .nav-list {
    |   display: flex;
    |   flex-flow: row wrap;
    |   justify-content: flex-end;
    | }
    | .nav-btn {
    |   margin-left: 25%;
    | }
section
  header.header.nav6
    div.nav-wrapper
      div.logo
        a(href="#") LOGO
      nav.navigation
        ul.nav-list
          each i in [1,2,3,4]
            li.nav-item
              span.nav-link= `LINK${i}`
          li.nav-btn
            a.btn(href="#") Button
  pre.code
    | justify-content: space-between;
    | .navigation {
    |   display: flex;
    |   flex-flow: row nowrap;
    |   justify-content: space-around;
    |   width: 100%;
    | }
    | .navigation .nav-btn {
    |   position: absolute
    |   right: 0
    | }
              
            
!

CSS

              
                // reset
*
  box-sizing: border-box
ul, li, header, div, nav, p, section
  margin: 0
  padding: 0
ul
  list-style none
html, body
  margin: 0
  padding: 0
  width: 100%
section
  margin-bottom: 30px
.code
  text-style: italic
  padding: 1em
  margin: .5em 1em .5em
  background: #f4f4f4
  border: 1px solid #f0f0f0
  border-radius: .25em
  
// design
.header
  color: #f7f8f9
  position: relative
  padding: 1em 1.5em
  background: #3d3f44
  width: 100%
 .logo, .nav-link
   cursor: pointer
  a 
    color: #f7f8f9
    text-decoration: none
.logo a
  display: block
  font-size: 108%
  font-weight: 500
  line-height: 1
  letter-spacing: .1em
  padding: .75em
  border: 1px solid #f7f8f9
.btn
  color: #f7f8f9
  padding: .75em 1em
  background-color: #339bc3
  text-decoration: none
  text-transform: uppercase
  &:hover
    background-color: #339bc3
.nav-list
  display: flex
  flex-flow: row wrap
  padding: 0 1em
.nav-item
  border-right: 1px solid  #666
  &:first-child
    border-left: 1px solid #666
.nav-link
  padding: .5em 1.5em

// layout
.nav-wrapper
  display: flex
  flex-flow: row nowrap
  align-items: baseline
  width: 100%

.nav1 .nav-wrapper
  justify-content: space-between

.nav2 .nav-wrapper
  justify-content: flex-start
  .navigation
    margin: 0 auto

.nav3 .nav-wrapper
  justify-content: flex-end
  .logo
    margin-right: auto

.nav4
  .nav-wrapper
    justify-content: flex-start
  .navigation
    display: flex
    flex-flow: row nowrap
    justify-content: center
    width: 100%
  .nav-list
    margin: 0 auto
  
.nav5
  .nav-item
    &:last-chaild
      border: none
  .nav-btn
     padding-left: 1em
  .nav-wrapper
    justify-content: space-between
  .navigation
    width: 100%
  .nav-list
    padding-right: 0
    justify-content: flex-end
  .nav-item
    &:first-child
      // margin-left: auto
  .nav-btn
    margin-left: 25%

.nav6
  .nav-item
    &:last-chaild
      border: none
  .nav-btn
     padding-left: 1em
  .nav-wrapper
    position: relative
    justify-content: space-between
  .navigation
    display: flex
    flex-flow: row nowrap
    justify-content: space-around
    width: 100%
  .nav-btn
    position: absolute
    right: 0
              
            
!

JS

              
                
              
            
!
999px

Console