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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

            
              <article class="print-like">
  <header class="intro">
    <h1 class="title">Print-like Layouts on the web</h1>
    <p class="summary">We've been stuck for decades in the simetrical columns paradign. Let's try to spice things up a little.</p>
    <address class="author">By <a rel="author" href="https://twitter.com/fcorradini">Facundo Corradini</a><br/>
    </address>
  </header>
  <img class= "main-image" src="https://placeimg.com/640/480/animals/sepia" alt="random image"/>
  <section class="main-text">
    <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos, dolores unde nisi enim temporibus, beatae odit provident itaque esse impedit iure nemo adipisci officiis maxime et numquam repudiandae, eius voluptate.</p>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Recusandae cumque impedit quisquam, nostrum accusantium reprehenderit sunt. Ex molestias pariatur omnis autem vero distinctio veniam odit necessitatibus! Voluptatibus inventore quo at.Fuga cum nostrum ipsum itaque est iusto culpa optio ducimus recusandae molestiae! Illo quo ex omnis, itaque quia, magnam porro quaerat nemo odit, ab quis voluptas sed harum optio est?</p>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Natus error ipsum recusandae quo veritatis vel voluptas at officiis modi perferendis. Sequi nihil voluptatem iste dolorem est, quidem adipisci tempora vitae.</p>
  </section>  
</article>

            
          
!

CSS

            
              body{
  background-color: #EDD7BB;
  font-family: serif;
  line-height: 120%;
  font-size: 18px;
  margin: 20px;
}

.print-like{
  margin: 20px auto;
  max-width: 1200px;
}

a{
  color: darkred;
  font-weight: 700;
}

.title{
  text-align: center;
  line-height: 1em;
}

.summary{
  font-size: 1.4rem;
  text-align: center;
}
.author{
  font-style: normal;
  font-size: 0.9em;
  border-top: 4px solid black;
  padding: .2em;
}

.main-image{
   width: 100%; /* for actual production code it'd probably be better to use picture and multiple image sources */
}
.main-text{
  margin:20px 0;
}
@media screen and (min-width: 600px){
  .print-like{
    display: grid;
  }
  .main-image{
    grid-row: 3/4;    
  }
  .main-text{
    column-count: 2;
  }
  .main-text :first-child{
    margin-top:0;
  }
  .main-text :last-child{
    margin-bottom: 0;
  }
}

@media screen and (min-width: 900px){
  .print-like{
    grid-template-columns: 1fr 320px 1fr;
    align-items: center;
  }
  .title{
    margin-top: 0;
  }
  .intro{
    grid-row:1;
    grid-column: 2/3;
    max-width: 300px;
  }
  
  .main-text{
    column-gap: 320px;
    grid-row: 1;
    grid-column: 1/4;
  }
  .main-image{
    grid-column: 1 / -1;
    margin: 0 auto;
  }
  
  @supports (-ms-wrap-flow: both){
    .title{
      -ms-wrap-flow: both;
      position: absolute;
      right: 25%;
      padding: 10px 20px;
    }
  }
}
            
          
!

JS

            
              
            
          
!
999px

Console