Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">

<div class="wrapper">
  <h2>Recent Articles</h2>
  <div class="flex">
    
    <div class="flex-item flex-item--feature">
      <img src="https://i.picsum.photos/id/512/300/100.jpg?hmac=sc8hRQLFQFIAMBMm9e7crSQlzbtRFRbqZE4N_fMhooY" alt="cat" />
      <h2>Article #1: Your headline here.</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ligula enim, placerat sit amet enim sed, elementum auctor diam. Nunc finibus sagittis viverra. Aliquam erat volutpat. Vivamus tempor fermentum volutpat. Cras volutpat tortor id vehicula rutrum. Praesent eu ligula ac.</p>
    </div>
    
    <div class="flex-item">
      <img src="https://i.picsum.photos/id/1081/300/200.jpg?hmac=fbKeKxgZkfNvHihq19otFEq3XIIskrkKx0agOvAsFlI" alt="cat" />
      
      <h2>Article #2: Your headline here.</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eleifend nunc in odio tempor, vel porttitor nunc lobortis. Etiam sit amet mollis elit. Quisque massa sem, eleifend non ultrices non.</p>
    </div>
    
    <div class="flex-item">
      <img src="https://i.picsum.photos/id/1081/300/200.jpg?hmac=fbKeKxgZkfNvHihq19otFEq3XIIskrkKx0agOvAsFlI" alt="cat" />
      <h2>Article #3: Your headline here.</h2>
      <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc molestie turpis non erat elementum, non.</p>
      </div>
    
    <div class="flex-item">
      <img src="https://i.picsum.photos/id/107/300/200.jpg?hmac=1ChAQunGwvU9ZitmS9YO3D5NBW_bFoYG1mg_5qWfAZ4" alt="cat" />
      
      
      <h2>Article #4: Your headline here.</h2>
      <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc molestie turpis non erat elementum, non.</p>
      </div>
    
  </div>
  
</div>
              
            
!

CSS

              
                body{
  font-family: 'Roboto', sans-serif;
  box-sizing: border-box;
}

.wrapper{
  width: 960px;
  margin: auto;
}

.flex{
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 15px;
}

.flex-item{
  flex: 1;
  flex-basis: 28%;
  background-color: #f9f9f9;
  border: 1px solid lightgrey;
  padding: 10px 15px;
  border-radius: 5px;
}

.flex-item--feature{
  flex-basis: 100%;
}


.flex-item img{
  width: 100%;
  height: auto;
  border-radius: 3px;
  box-shadow: 2px 1px 1px #ccc;
}
              
            
!

JS

              
                
              
            
!
999px

Console