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

              
                <div class="grid-container">
  <div class="item-1">
    <a href="https://www.lambdatest.com/blog/best-ci-cd-tools/" class="card" target="_blank">
      <div class="thumb" style="background-image: url(https://www.lambdatest.com/blog/wp-content/uploads/2022/07/image27-3-1.png);"></div>
      <article>
        <h1>38 Best CI/CD Tools For 2023</h1>
        <span>Himanshu Sheth</span>
      </article>
    </a>
  </div>
  <div class="item-2">
    <a href="https://www.lambdatest.com/blog/selenium-manager-in-selenium-4-11-0/" class="card" target="_blank">
      <div class="thumb" style="background-image: url(https://www.lambdatest.com/blog/wp-content/uploads/2023/08/unnamed-60-1-1-1.png);"></div>
      <article>
        <h1>Selenium Manager in Selenium 4.11.0: New Features and Improvements</h1>
        <p>Selenium WebDriver, as everyone knows, is used for automating browsers. It is used widely by many organizations for web automation testing...</p>
        <span>Faisal Khatri</span>
      </article>
    </a>
  </div>
  <div class="item-3">
    <a href="https://www.lambdatest.com/blog/test-scenario-vs-test-case/" class="card" target="_blank">
      <div class="thumb" style="background-image: url(https://www.lambdatest.com/blog/wp-content/uploads/2023/07/test2520scenario2520vs2520test2520case2520og.png);"></div>
      <article>
        <h1>Test Scenario vs Test Case: Core Differences</h1>
        <p>Test scenario and test case are the two commonly used terms in the software testing domain. These terms are regarded as the building block of testing...</p>
        <span>Nazneen Ahmad</span>
      </article>
    </a>
  </div>
  <div class="item-4">
    <a href="https://www.lambdatest.com/blog/css-refactoring/" class="card" target="_blank">
      <div class="thumb" style="background-image: url(https://www.lambdatest.com/blog/wp-content/uploads/2023/03/unnamed252520-2525202023-03-15T174705.891.png);"></div>
      <article>
        <h1>A Complete Guide to CSS Refactoring</h1>
        <p>Being a front-end developer is like having the magical power to shape reality after it’s been created...</p>
        <span>Adarsh Gupta</span>
      </article>
    </a>
  </div>
  <div class="item-5">
    <a href="https://www.lambdatest.com/blog/css-cascade-layers/" class="card" target="_blank">
      <div class="thumb" style="background-image: url(https://www.lambdatest.com/blog/wp-content/uploads/2023/06/Complete-Guide-To-CSS-Cascade-Layers.png);"></div>
      <article>
        <h1>A Complete Guide To CSS Cascade Layers</h1>
        <p>“Design is not just what it looks like and feels like. Design is how it works,” – Steve Jobs. These words perfectly capture the essence of creating captivating websites...</p>
        <span>Tahera Alam</span>
      </article>
    </a>
  </div>
  <div class="item-6">
    <a href="https://www.lambdatest.com/blog/automating-react-virtual-dom-in-selenium/" class="card" target="_blank">
      <div class="thumb" style="background-image: url(https://www.lambdatest.com/blog/wp-content/uploads/2023/05/unnamed-2023-05-15T200510.802-1.png);"></div>
      <article>
        <h1>Using React Virtual DOM To Improve Web Application Performance</h1>
        <p>If you don’t know, HTML is the most widely used markup language for creating web pages supported by all major browsers like Google Chrome, Mozilla Firefox, and Safari...</p>
        <span>Bonnie</span>
      </article>
    </a>
  </div>
  <div class="item-7">
    <a href="https://www.lambdatest.com/blog/best-css-button-hover-effects/" class="card" target="_blank">
      <div class="thumb" style="background-image: url(https://www.lambdatest.com/blog/wp-content/uploads/2023/08/FI-1-1-1.png);"></div>
      <article>
        <h1>41 Best CSS Button Hover Effects in 2023</h1>
        <p>Buttons are everywhere on the web; they have proven to be an indispensable component of modern web design...</p>
        <span>Alex Anie</span>
      </article>
    </a>
  </div>
</div>

              
            
!

CSS

              
                html {
  background: #f5f7f8;
  font-family: 'Roboto', sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 20px 0;
}

.grid-container {
  width: 90%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  grid-gap: 20px;
}

@media only screen and (min-width: 500px) {
  .grid-container {
    grid-template-columns: 1fr 1fr;
  }  
  .item-1 {
  grid-column: 1/ span 2;
  }
  .item-1 h1 {
    font-size: 30px;
  }
}

@media only screen and (min-width: 850px) {
  .grid-container {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

/* card */

.card {
  min-height: 100%;
  background: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #444;
  position: relative;
  top: 0;
  transition: all .1s ease-in;
}

.card:hover {
  top: -2px;
  box-shadow: 0 4px 5px rgba(0,0,0,0.2);
}

.card article {
  padding: 20px;
  display: flex;
  flex: 1;
  justify-content: space-between;
  flex-direction: column;
}
.card .thumb {
  padding-bottom: 60%;
  background-size: cover;
  background-position: center center;
}

.card p { 
  flex: 1; 
  line-height: 1.4;
}

h1 {
  font-size: 20px;
  margin: 0;
  color: #333;
}

.card span {
  font-size: 12px;
  font-weight: bold;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 2em 0 0 0;
}
              
            
!

JS

              
                
              
            
!
999px

Console