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 class="grid">
    <div class="grid__item grid__item--fixed">Item 1 - FIXED</div>
    <div class="grid__item">Item 2</div>
    <div class="grid__item grid__item--big">Item 3</div>
    <div class="grid__item grid__item--tall">Item 4</div>
    <div class="grid__item grid__item--tall">Item 5</div>
    <div class="grid__item">Item 6</div>
    <div class="grid__item grid__item--wide">Item 7</div>
    <div class="grid__item">Item 8</div>
    <div class="grid__item">Item 9</div>
    <div class="grid__item grid__item--wide">Item 10</div>
    <div class="grid__item grid__item--tall">Item 11</div>
    <div class="grid__item">Item 12</div>
    <div class="grid__item grid__item--big">Item 13</div>
    <div class="grid__item grid__item--wide">Item 14</div>
    <div class="grid__item grid__item--wide">Item 15</div>
    <div class="grid__item">Item 16</div>
    <div class="grid__item grid__item--tall">Item 17</div>
    <div class="grid__item">Item 18</div>
    <div class="grid__item">Item 19</div>
    <div class="grid__item">Item 20</div>
    <div class="grid__item grid__item--big">Item 21</div>
    <div class="grid__item grid__item--wide">Item 22</div>
    <div class="grid__item">Item 23</div>
    <div class="grid__item grid__item--tall">Item 24</div>
    <div class="grid__item">Item 25</div>
    <div class="grid__item">Item 26</div>
    <div class="grid__item">Item 27</div>
    <div class="grid__item">Item 28</div>
    <div class="grid__item grid__item--wide">Item 29</div>
    <div class="grid__item">Item 30</div>
    <div class="grid__item">Item 31</div>
    <div class="grid__item">Item 32</div>
    <div class="grid__item">Item 33</div>
    <div class="grid__item grid__item--big">Item 34</div>
    <div class="grid__item grid__item--wide">Item 35</div>
    <div class="grid__item">Item 36</div>
    <div class="grid__item">Item 37</div>
    <div class="grid__item">Item 38</div>
    <div class="grid__item">Item 39</div>
    <div class="grid__item">Item 40</div>
    <div class="grid__item grid__item--wide">Item 41</div>
    <div class="grid__item grid__item--tall">Item 42</div>
    <div class="grid__item">Item 43</div>
    <div class="grid__item">Item 44</div>
    <div class="grid__item">Item 45</div>
    <div class="grid__item grid__item--big">Item 46</div>
    <div class="grid__item">Item 47</div>
    <div class="grid__item">Item 48</div>
    <div class="grid__item grid__item--tall">Item 49</div>
    <div class="grid__item">Item 50</div>
    <div class="grid__item">Item 51</div>
    <div class="grid__item grid__item--tall">Item 52</div>
    <div class="grid__item">Item 53</div>
    <div class="grid__item">Item 54</div>
    <div class="grid__item">Item 55</div>
</div>
              
            
!

CSS

              
                * {
    box-sizing: border-box;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); // Fill, keeps 50px and creates empty tracks
    grid-gap: 1em;
    grid-auto-flow: dense;
    
    margin: 1rem 0;
}

.grid--fit {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); // Fit, fills space if space left
}

.grid__item {
    display: block;
    padding: 2em;
    
    font-size: 1.2rem;
    color: #f5f5f5;
    text-align: center;
    background: #82C7EB;
}

.grid__item--wide {
    grid-column-end: span 2;
    
    background: #F5FAC8;
    color: #8EA1F0;
}

.grid__item--big {
    grid-column-end: span 2;
    grid-row-end: span 2;
    
    background: #8EA1F0;
    color: #F5FAC8;
}

.grid__item--tall {
    grid-row-end: span 2;
    
    background: #A5F0E4;
    color: #82C7EB;
}

.grid__item--fixed {
    grid-row: 4;
    grid-column: 1 / -1;
    background: #BC4F4F;
}

.title {
    margin: 4rem 0 2rem;
    padding: 0 1em;
 
    color: #8EA1F0;
}
              
            
!

JS

              
                
              
            
!
999px

Console