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

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

              
                <div class="articles-wrapper">
  <article class="article">
    <a href="https://craigwfox.com/posts/where-is-and-has/">
      <time>August 2, 2022</time>
      <h2>Using CSS where(), is(), and has()</h2>
      <p>An overview of how the where(), is(), and has() pseudo classes work and examples of different ways to utilize them in your day to day work.</p>
      <span class="read-more">Read about using where(), is(), and has() </span>
    </a>
  </article>

  <article class="article">
    <a href="https://craigwfox.com/posts/fluid-type-and-sizing/">
      <time>May 13, 2022</time>
      <h2>Fluid type and sizing in CSS</h2>
      <p>A guide to using clamp(), min(), and max() to create fluid type and sizing in CSS.</p>
      <span class="read-more">Read about fluid sizing</span>
    </a>
  </article>

  <article class="article">
    <a href="https://craigwfox.com/posts/theme-toggle-web-component/">
      <time>March 10, 2022</time>
      <h2>A web component to toggle themes</h2>
      <p>A simple web component to toggle the site themes and modes.</p>
      <span class="read-more">Read about toggling themes</span>
    </a>
  </article>

  <article class="article">
    <a href="https://craigwfox.com/posts/responsive-video-embeds/">
      <time>February 7, 2022</time>
      <h2>Responsive / fluid width videos</h2>
      <p>A look at how responsive videos have been done in the past and how we can do them now.</p>
      <span class="read-more">Read about using responsive videos</span>
    </a>
  </article>

  <article class="article">
    <a href="https://craigwfox.com/posts/methods-for-equal-height-columns/">
      <time>November 28, 2021</time>
      <h2>Methods for equal height columns</h2>
      <p>The different ways I've created equal height columns, since I first started making websites.</p>
      <span class="read-more">Read about equal height columns</span>
    </a>
  </article>
</div>
              
            
!

CSS

              
                :root {
  --clr-bg: hsl(220 39% 10%);
  --clr-bg-alt: hsl(220 49% 15%);
  --clr-link: hsl(199 100% 65%);
  --clr-link-hover: hsl(43 100% 65%);
  --clr-text-base: hsl(220 39% 95%);
}

body {
  background: var(--clr-bg);

  color: var(--clr-text-base);
}

.articles-wrapper {
  max-width: 65rem;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--step-3);

  padding: var(--step-5);
  margin-inline: auto;
}

.article {
  display: flex;

  &:first-child {
    grid-column: 1 / -1;
  }

  time {
    grid-area: date;
  }

  h2 {
    grid-area: title;
    margin-bottom: 2rem;
    color: var(--clr-link);
  }

  p {
    grid-area: content;
    transition: all 0.2s ease-in-out;
  }

  .read-more {
    grid-area: more;

    overflow: hidden;

    position: absolute;
    bottom: -4rem;

    color: var(--clr-link-hover);
    text-decoration: underline;
    transition: all 0.2s ease-in-out;
  }

  a {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, auto) 1fr auto;
    grid-template-areas: "date" "title" "content" "more";
    gap: var(--step--1);

    padding-block: var(--step-2);
    padding-inline: var(--step-2);

    overflow: hidden;

    position: relative;

    border-top-right-radius: var(--step-3);
    background: var(--clr-bg-alt);
    border-block-end: 1rem solid var(--clr-link-hover);

    color: currentcolor;
    text-decoration: none;

    &:hover,
    &:focus {
      .read-more {
        transform: translateY(-4rem);
      }

      p {
        transform: translateY(-2rem);
      }

      h2 {
        color: var(--clr-link-hover);
      }
    }
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console