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

              
                <main>
  <header class="page-header">
    <h1>Blog</h1>
  </header>
  <section class="blog-page--grid">
    <article class="blog-page--card">
      <figure>
        <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/764894/generald-service-1.jpg' alt=''>
      </figure>
      <header class="blog-page--card-header">
        <h2 class="blog-page--title">Blog Post Title</h2>
        <p class="blog-page--date">Feb 20, 2020</p>
      </header>
      <p class="blog-page--excerpt">With routine exams and cleanings, you can keep your teeth and gums healthy. We
        recommend you visit our office for an exam and cleaning every three to six months. <a href="#">Read More</a></p>
      <div class="blog-page--category">
        <p class="blog-page--category-label">Services</p>
        <p class="blog-page--category-label">Doctor Tips</p>
      </div>
    </article>
    
    <article class="blog-page--card">
      <figure>
        <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/764894/generald-service-1.jpg' alt=''>
      </figure>
      <header class="blog-page--card-header">
        <h2 class="blog-page--title">Blog Post Title</h2>
        <p class="blog-page--date">Feb 20, 2020</p>
      </header>
      <p class="blog-page--excerpt">With routine exams and cleanings, you can keep your teeth and gums healthy. We
        recommend you visit our office for an exam and cleaning every three to six months. <a href="#">Read More</a></p>
      <div class="blog-page--category">
        <p>Services</p>
        <p>Doctor Tips</p>
      </div>
    </article>
    
    <article class="blog-page--card">
      <figure>
        <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/764894/generald-service-1.jpg' alt=''>
      </figure>
      <header class="blog-page--card-header">
        <h2 class="blog-page--title">Blog Post Title</h2>
        <p class="blog-page--date">Feb 20, 2020</p>
      </header>
      <p class="blog-page--excerpt">With routine exams and cleanings, you can keep your teeth and gums healthy. We
        recommend you visit our office for an exam and cleaning every three to six months. <a href="#">Read More</a></p>
      <div class="blog-page--category">
        <p>Services</p>
        <p>Doctor Tips</p>
      </div>
    </article>
    
    <article class="blog-page--card">
      <figure>
        <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/764894/generald-service-1.jpg' alt=''>
      </figure>
      <header class="blog-page--card-header">
        <h2 class="blog-page--title">Blog Post Title</h2>
        <p class="blog-page--date">Feb 20, 2020</p>
      </header>
      <p class="blog-page--excerpt">With routine exams and cleanings, you can keep your teeth and gums healthy. We
        recommend you visit our office for an exam and cleaning every three to six months. <a href="#">Read More</a></p>
      <div class="blog-page--category">
        <p>Services</p>
        <p>Doctor Tips</p>
      </div>
    </article>
    
    <article class="blog-page--card">
      <figure>
        <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/764894/generald-service-1.jpg' alt=''>
      </figure>
      <header class="blog-page--card-header">
        <h2 class="blog-page--title">Blog Post Title</h2>
        <p class="blog-page--date">Feb 20, 2020</p>
      </header>
      <p class="blog-page--excerpt">With routine exams and cleanings, you can keep your teeth and gums healthy. We
        recommend you visit our office for an exam and cleaning every three to six months. <a href="#">Read More</a></p>
      <div class="blog-page--category">
        <p>Services</p>
        <p>Doctor Tips</p>
      </div>
    </article>
    
    <article class="blog-page--card">
      <figure>
        <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/764894/generald-service-1.jpg' alt=''>
      </figure>
      <header class="blog-page--card-header">
        <h2 class="blog-page--title">Blog Post Title</h2>
        <p class="blog-page--date">Feb 20, 2020</p>
      </header>
      <p class="blog-page--excerpt">With routine exams and cleanings, you can keep your teeth and gums healthy. We
        recommend you visit our office for an exam and cleaning every three to six months. <a href="#">Read More</a></p>
      <div class="blog-page--category">
        <p>Services</p>
        <p>Doctor Tips</p>
      </div>
    </article>

  </section>

</main>
              
            
!

CSS

              
                :root {
  --ltblue: #0767a2;
  --dkblue: #0d0c61;
  --gray: #75767a;
}

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

main {
  margin: 0 auto;
  font-family: "Roboto Condensed", sans-serif;
}

.page-header {
  width: 100%;
  background: var(--gray);
  padding: 1em;
  margin-bottom: 3%;
  text-align: center;
}

h1 {
  color: #ffffff;
  margin: 0;
  font-weight: 400;
}

.blog-page--grid {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
  font-weight: 600;
  margin: 1em 10em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  grid-template-rows: auto;
  gap: 30px;
}

.blog-page--card {
  min-height: 100px;
  max-width: 500px;
  border-bottom: 6px solid var(--dkblue);
  background: #ffffff;
  box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.08);
}

.blog-page--card:hover {
  transform: scale(1.02);
  transition: ease-in 0.2s;
}

figure {
  margin: 0;
}

figure img {
  width: 100%;
  object-fit: contain;
  margin-bottom: 0.5em;
}

.blog-page--card-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0.5em 2em 0.25em;
}

.blog-page--title {
  font-size: 1.5em;
  line-height: 1.4em;
  color: var(--ltblue);
  margin: 0;
}

.blog-page--date {
  justify-self: end;
  margin: 0;
  text-transform: uppercase;
  color: var(--gray);
  letter-spacing: 0.025em;
  font-weight: 600;
}

.blog-page--excerpt {
  margin: 0 2em 1em 2em;
  font-weight: normal;
  line-height: 1.45em;
}

.blog-page--excerpt a {
  text-decoration: none;
  font-weight: 600;
  font-style: italic;
  color: var(--dkblue);
}

.blog-page--excerpt a::after {
  content: ">";
  padding: 0 0 0 4px;
  top: 1px;
}

.blog-page--category {
  margin: 0 2em 2em;
  display: flex;
}

.blog-page--category p {
  margin: 0 0.5em 0 0;
  font-weight: 500;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  width: max-content;
  text-align: center;
  background: var(--ltblue);
  padding: 5px 10px;
}

              
            
!

JS

              
                
              
            
!
999px

Console