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

              
                .app
  header.masthead
  
    // Try moving elements on this level up and down the HTML structure (inside of .masthead). Changing the HTML has no effect on the visual layout.
    
    .contact
      .contact-group
        p <span>Call: </span>1-800-123-4567 | &nbsp;
      .contact-group
        p <span>Email:</span> info@this.com
    h1.logo canvas
    nav.main-nav
      ul
        li Home
        li Men
        li Women
        li Accessories
        li Sale
        li Blog
        li Videos
        li Contact
    .masthead-features
      .features-group
        .features-icon <i class="zmdi zmdi-thumb-up"></i>
        p Original Brands
        p 100% Guaranteed
      .features-group
        .features-icon <i class="zmdi zmdi-truck"></i>
        p Free Shipping
        p on $20 or more
      .features-group
        .features-icon <i class="zmdi zmdi-replay"></i>
        p 30 Day Returns
        p completely free
    .login
      .currency
        p $USD <i class="zmdi zmdi-chevron-down"></i>
      .lang
        p en <i class="zmdi zmdi-chevron-down"></i>
      .login-link
        p Login <i class="zmdi zmdi-chevron-down"></i>
    p.shopping-cart <i class="zmdi zmdi-shopping-basket"></i>
      span 3

              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Lato:400,400i,700")

body
  font-family: Lato, sans-serif
  background: 
    color: #eaeaea
  color: #333

// main grid

.app
  display: grid
  grid-template-columns: repeat(14, 1fr)
  
// masthead / header container

.masthead
  display: grid
  grid-template-columns: subgrid
  // must be set to cross all grid columns
  grid-column: 1 / -1
  
// main navigation

.main-nav
  grid-row: 3
  // allows the borders to go all the way across
  grid-column: 1 / -1
  border-top: 1px solid rgba(0,0,0,.1)
  border-bottom: 1px solid rgba(0,0,0,.1)
  
  ul
    list-style: none
    padding: 2rem 1.5rem
    margin: 0
    display: flex
    
    li
      font-size: .9rem
      margin-right: 2rem
      font-weight: 700
      text-transform: uppercase
      letter-spacing: 1px
      
// shopping cart group

.shopping-cart
  grid-row: 3
  grid-column: 14
  margin: 0
  justify-self: end
  align-self: center
  padding-right: 1.5rem
  position: relative
  
  // cart icon
  
  i
    font-size: 1.5rem
  
  // notification number
  
  span
    position: absolute
    top: -10px
    right: 30%
    display: flex
    align-items: center
    justify-content: center
    background: 
      color: #1abc9c
    color: white
    padding: 5px
    border-radius: 50%
    height: 10px
    width: 10px
    font-size: .8rem
  
// logo mark

.logo
  grid-row: 2
  grid-column: 1 / 3
  margin: 2rem 0
  font-size: 2.5rem
  padding-left: 1.5rem
  
  
// 3 features (brands, shipping, returns)

.masthead-features
  grid-row: 2
  grid-column: 8 / 15
  display: flex
  grid-column-gap: 1rem
  justify-content: flex-end
  align-items: center
  padding-right: 1.5rem
  
// each features group

.features-group
  // create a new grid for the group
  display: grid
  grid-template-columns: auto 1fr 1fr
  align-items: center
  grid-column-gap: 1rem
  grid-row-gap: .2rem   
    
  // free shipping group
    
  &:nth-child(2)
    margin: 0 1rem    
  
  p
    grid-column: 2 / 4
    margin: 0
  
    // bottom text (green)
    
    &:nth-child(3)
      color: #1abc9c    
  
// features group icon

.features-icon
  grid-row: 1 / 3
  grid-column: 1
  margin: 0
  font-size: 2rem
  
// contact info
  
.contact
  grid-row: 1
  grid-column: 1 / 15
  display: flex
  border-bottom: 1px solid rgba(0,0,0,.1)
  padding-left: 1.5rem
  
  // bold label
  
  span
    font-weight: 600
    
// info in top right (currency, lang, login)

.login
  grid-row: 1
  grid-column: 8 / 15
  display: flex
  justify-self: end
  padding-right: 1.5rem
  
// language select element

.lang
  margin: 0 1rem
  padding: 0 1rem
  // creates left/right borders
  border-right: 1px solid rgba(0,0,0,.1)
  border-left: 1px solid rgba(0,0,0,.1)
  
  p
    text-transform: uppercase
    
// login button

.login-link
  p 
    text-transform: uppercase
    
              
            
!

JS

              
                
              
            
!
999px

Console