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

              
                div.notice
  p Sorry! A browser with GRID #[a( href='http://caniuse.com/#feat=css-grid' ) support] is required to view this pen.

div.grid.debug
  header.main-header header
  div.cell.cell--fig1 fig1
  div.cell 1
  div.cell 2
  div.cell.cell--fig2 fig2
  div.cell 3
              
            
!

CSS

              
                *
  box-sizing: border-box
  
html,
body
  background-color: #ebe9ea
  width: 100%
  min-height: 100%
  margin: 0
  padding: 0

body
  font-family: 'Philosopher', sans-serif
  color: #333

@supports (display: grid)
  .notice
    display: none
  
.notice
  width: 100%
  background-color: #333
  color: #fff
  padding: 1rem
  text-align: center
  font-family: 'Roboto', sans-serif
  font-weight: 700
  letter-spacing: 1px
  text-transform: uppercase
  a
    color: #fff
    text-decoration: none
    border-bottom: 1px solid white  
  
.grid
  min-height: 100vh

@media (min-width: 640px)
  .grid
    display: grid
    grid-gap: 20px
    grid-template-rows: 60px auto auto auto
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) minmax(300px, 1fr)

  .main-header
    grid-column: 1 / span 3
  
  .cell--fig1
    grid-column: 1 / span 3
  
  .cell--fig2
    grid-column: 1 / span 3

  .cell:nth-of-type(2)
    grid-column: 1 / span 1
    
  .cell:nth-of-type(3)
    grid-column: 2 / span 1
    
  .cell:nth-of-type(5)
    grid-column: 1 / span 2

@media (min-width: 980px)
  .grid
    grid-template-rows: 60px auto auto
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) minmax(300px, 1fr) minmax(300px, 1fr)
    
  .main-header
    grid-column: 1 / span 4
  
  .cell--fig1
    grid-row: 2
    grid-column: 1 / span 2
  
  .cell:nth-of-type(2)
    grid-column: 1 / span 1
    grid-row: 3
    
  .cell:nth-of-type(3)
    grid-column: 3
    grid-row: 2
 
  .cell:nth-of-type(5)
    grid-row: 2 / span 2
    grid-column: 4
  
  .cell--fig2
    grid-column: 2 / span 2
    grid-row: 3
    
.debug
  .main-header,
  .cell
    background-color: alpha(purple, 0.1)
    border: 1px solid alpha(purple, 0.2)
    font-size: 2.5rem
    font-family: Arial
    font-weight: bold
    color: alpha(purple, 0.2)
    padding: 10px
    line-height: 1    
  
  .cell
    min-height: 300px
    min-width: 300px

              
            
!

JS

              
                
              
            
!
999px

Console