Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

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.

            
              <h1>Latest Articles</h1>
<ul>
  <li>
      <!-- Photo by Erik-Jan Leusink on Unsplash -->
      <img src="https://images.unsplash.com/photo-1518791841217-8f162f1e1131?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80" alt="A lovely kitten sitting on a couch">
    <div class="text-container">
      <h2>Ccccccccccccaaaaaaaaaaaaaaatttttttttttttttttssssssssssssssss</h2>
      <hr>
      <p>Pet me pet me pet me pet me, bite, scratch, why are you petting me. I shall purr myself to sleep. Lick sellotape scratch the furniture so warm up laptop with butt lick butt fart rainbows until owner yells pee in litter box hiss at cats cat slap dog in face sleep on my human's head. Rub face on owner eat plants, meow, and throw up because i ate plants or make muffins, for jump five feet high and sideways when a shadow moves lick face hiss at owner, pee a lot, and meow repeatedly scratch at fence purrrrrr eat muffins and poutine until owner comes back scratch leg; meow for can opener to feed me kitty scratches couch bad kitty.</p>
    </div>
  </li>
  <li>
      <!-- Photo by Tran Mau Tri Tam on Unsplash -->
      <img src="https://images.unsplash.com/photo-1557246565-8a3d3ab5d7f6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80" alt="A brown cat with a scared face and stuck out tongue 😜">
    <div class="text-container">
      <h2>You can't close the door, i haven't decided whether or not i wanna go out attack feet</h2>
      <hr>
      <p>You are a captive audience while sitting on the toilet, pet me get suspicious of own shadow then go play with toilette paper yet rub butt on table and intently sniff hand, so bring your owner a dead bird murr i hate humans they are so annoying has closed eyes but still sees you. Curl into a furry donut touch water with paw then recoil in horror and morning beauty routine of licking self but stand in doorway, unwilling to chose whether to stay in or go out. Hey! you there, with the hands destroy the blinds and fall asleep on the washing machine.</p>
    </div>
  </li>
  <li>
      <!-- Photo by Michael Sum on Unsplash -->
      <img src="https://images.unsplash.com/photo-1519052537078-e6302a4968d4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80" alt="An orange cat sleeping on the floor">
    <div class="text-container">
      <h2>Paw at beetle and eat it before it gets away π•„π”Όπ•†π•Ž</h2>
      <hr>
      <p>Fall asleep upside-down cough hairball, eat toilet paper but howl on top of tall thing good morning sunshine yet litter kitter kitty litty little kitten big roar roar feed me. Walk on keyboard loved it, hated it, loved it, hated it or cat dog hate mouse eat string barf pillow no baths hate everything yet hunt anything that moves annoy owner until he gives you food say meow repeatedly until belly rubs, feels good the fat cat sat on the mat bat away with paws stares at human while pushing stuff off a table. </p>
    </div>
  </li>
</ul>
            
          
!
            
              /* Google fonts */
@import url('https://fonts.googleapis.com/css?family=Lora|Raleway&display=swap');

/* Styles for the overall layout of the page. Nothing important here */

body {
  padding: 2rem;
  background-color: #EDEFF5;
}

h1 {
  font-family: 'Lora', serif;
  font-size: 2rem;
  font-weight: 400;
  color: #1F313D;
  margin-bottom: 1rem;
}

/* Styles for positioning the cards. Just three lines of code? That's how awesome CSS grid is! */
ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-gap: 1rem;
}

ul li {
  background: white;
  border: 1px solid #EDEFF5;
  box-shadow: 2px 4px 14px rgba(141, 153, 174, 0.18);
  border-radius: .25rem;
}

ul li img {
  width: 100%;
  border-top-left-radius: .25rem;
  border-top-right-radius: .25rem;
}

.text-container {
  padding: 1rem;
}

.text-container h2 {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #1F313D;
  /* The styles here are meant to truncate titles that are too long. The first line ensures long text doesn't overflow its container. The second one ensures we title gets truncated */
  overflow: hidden;
  white-space: nowrap;
  /* Then, we show the three dots if the title is too long to be readable */
  text-overflow: ellipsis;
}

.text-container hr {
  border: none;
  border-top: 1px solid #EDEFF5;
}

.text-container p {
  font-family: 'Raleway', sans-serif;
  font-style: .8rem;
  color: #607380;
  line-height: 1.5rem;
  /* Here's where the line-clamp magic begins. First, we need to hide the content that overflows our desired number of text lines to show */
  overflow: hidden;
  /* Then, we use the old implementation of Flexbox on the paragraph and set its direction to be row */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  /* Finally, we set the desired number of lines we want to show */
  -webkit-line-clamp: 3;
}
            
          
!
999px
πŸ•‘ One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console