Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="content">
<div class="grid">
    <div class="headline">
        <div>
            <h1>Here Is The Main Headline</h1>
            <small>Class aptent per conubia nostra, per inceptos himenaeos.</small>
        </div>
    </div>
    <div class="main">
        <p>Quisque lobortis sem eu magna pulvinar commodo. Integer ac suscipit quam.<br><br>
        Nam mattis nibh orci, dictum hendrerit est pellentesque sit amet.</p>
    </div>
    <div class="item even">
        <div class="top">
            <img src="https://gratisography.com/thumbnails/gratisography-306-thumbnail.jpg"/>
        </div>
        <h2>Title One</h2>
        <p class="middle">Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
        <a class="btn">More</a>
    </div>
    <div class="item odd">
        <div class="top">
            <img src="https://gratisography.com/thumbnails/gratisography-308-thumbnail.jpg"/>
        </div>
        <h2>Title Two</h2>
        <p class="middle">Suspendisse tellus mauris, congue ultrices consequat ut, vestibulum id quam.</p>
        <a class="btn">More</a>
    </div>
    <div class="item even">
        <div class="top">
            <img src="https://gratisography.com/thumbnails/gratisography-332-thumbnail.jpg"/>
        </div>
        <h2>Title Three<br>The Larger Title</h2>
        <p class="middle">Mauris pellentesque mollis nibh non porta. Aliquam et orci lectus.</p>
        <a class="btn">More</a>
    </div>
    <div class="item odd">
        <div class="top">
            <img src="https://gratisography.com/thumbnails/gratisography-316-thumbnail.jpg"/>
        </div>
        <h2>Title Four</h2>
        <p class="middle">Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
        <a class="btn">More</a>
    </div>
</div>
</div>

<div class="footer">Photos brought to you by Gratisography</div>
            
          
!
            
              * {
    padding: 0;
    margin: 0;
}

*, *:before, *:after {
    box-sizing: border-box;
}

html {
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

html, body {
    height: 100%;
    font-family: tahoma, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: rockwell, serif;
    text-transform: uppercase;
}

.content {
    max-width: 1000px;
    margin: auto;
    padding: 2em 0;
}

html, body {
    background-color: #192a29;
}

.main {
    margin: 2.5rem 0;
    color: #ccc;
}

.headline {
    padding: 1em;
    padding-right: 30%;
    background: transparent;
    border: 10px solid #fff;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;

    color: #ccc;
    min-height: 200px;
}

.headline > div {
    top: 0;
    bottom: 0;
    margin: auto;
    text-transform: uppercase;
}

.item {
    background: #eee;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    border: 10px solid #fff;
    text-align: center;
    position: relative;
    margin-bottom: 2rem;
}

.top {
    width: 100%;
    height: auto;
    margin-bottom: 1em;
    position: relative;
}

.top > img {
    width: 100%;
}

.triangle {
    position: absolute;
    width: 0;
    height: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    border-left: 75px solid transparent;
    border-right: 75px solid transparent;
    border-bottom: 50px solid #eee;
}

.middle {
    padding: 1em;
    -webkit-flex-grow: 1;
    flex-grow: 1;
}

.btn {
    padding: 1em 2.5em;
    margin: auto;
    background-color: #707767;
    color: #fff;
    transition: background-color .3s ease;

}

.btn:hover {
    background-color: #384941;
}

@media screen and (min-width: 48em) {
    .content {
        padding: 2em;
    }

    .grid > div{
        width: 47%;
        float: left;
        margin-left: 3%;
        margin-bottom: 3rem;
    }

    .headline {
        min-height: 400px;
    }

    .odd {
        margin-top: -17rem;
    }
}

/* Grid Settings and Resets */

@supports (display: grid) {
    .odd {
        margin-top: auto;
    }
    .grid > div {
        width: auto;
        margin: 0;
    }

    .main {
        margin: 2rem 0 !important;
    }

    .item {
        margin-bottom: 0;
    }

}

.grid {
    display: grid;
    grid-gap: 1.6em;
    grid-template-columns: 1fr;
    grid-auto-flow: columns;
}

.headline, .item {
    grid-row: span 2;
}

@media screen and (min-width: 48em) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }
}

.footer {
  width: 100%;
  color: gray;
  text-align: center;
  padding: 1rem;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console