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

              
                <h1>Media Object List</h1>
<ul class="media-object-list">
  <li>
    <a class="mo-wrapper-link" href="#">
      <div class="mo-img">
        <img src="https://via.placeholder.com/500" alt="Placeholder">
      </div>
      <div class="mo-txt">
        <h3>Media Object Wrapped by an Anchor Tag</h3>
        <p>Description Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid veniam quos corrupti, consequuntur natus non adipisci assumenda porro doloribus nesciunt voluptate exercitationem. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum, officia!</p>
        <button class="button">Button</button>
      </div>
    </a>
  </li>
  <li>
    <div class="mo-img">
      <a href="#"><img src="https://via.placeholder.com/500" alt="Placeholder"></a>
    </div>
    <div class="mo-txt">
      <h3><a href="#">Media Object With Inline Links (No Wrapping Anchor Tag)</a></h3>
      <p>Description Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
      <a href="#" class="button">Link Button</a>
    </div>
  </li>
  <li class="mo-large mo-centered">
    <div class="mo-img">
      <a href="#"><img src="https://via.placeholder.com/500" alt="Placeholder"></a>
    </div>
    <div class="mo-txt">
      <h3><a href="#">Large Media Object, Vertically Centered</a></h3>
      <p>Description Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
      <a href="#" class="button">Link Button</a>
    </div>
  </li>
  <li class="mo-small">
    <div class="mo-img">
      <a href="#"><img src="https://via.placeholder.com/500" alt="Placeholder"></a>
    </div>
    <div class="mo-txt">
      <h3><a href="#">Small Media Object</a></h3>
      <p>Description Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
      <p><a href="#">Text Link</a></p>
    </div>
  </li>
</ul>

<h2>Default/Inherited Design System Elements</h2>
<p>To compare and test with a hypothetical design system's default styling.</p>

<h3>H3. Heading Level Three</h3>
<p>Paragraph. Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ratione reiciendis quam vero perferendis? Numquam non error quasi quibusdam. Provident labore, libero fugiat dolore accusantium, dicta hic modi ab saepe ad, quas nulla tempora unde! Enim praesentium, excepturi minima sed obcaecati, quis consectetur quod blanditiis nisi iusto earum, non amet consequatur.</p>
<p><a href="#">Link</a></p>
<button>Button</button>
<a href="#" class="button">Link Button</a>
              
            
!

CSS

              
                .media-object-list {
  list-style: none;
  margin: 0;
  padding: 0;

  li {
    margin: 1em 0 2em 0;
  }

  a {
    text-decoration: none;
  }

  li,
  .mo-wrapper-link {
    display: flex;
    padding: 1em 0;
  }

  .mo-centered {
    align-items: center;
  }

  .mo-wrapper-link {
    p {
      color: rgba(0, 0, 0, 0.7);
      &.link {
        color: inherit;
      }
      &.button {
        color: rgba(255, 255, 255, 1);
      }
    }
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      color: inherit;
    }
    &:hover {
      background-color: rgba(0, 0, 0, 0.05);
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p {
    margin: 0 0 0.5em 0;
  }

  .mo-img {
    width: 25%;
    max-width: 200px;
  }

  .mo-txt {
    width: 75%;
    padding: 0 1em;
  }

  .mo-large {
    .mo-img {
      width: 33.3333%;
      max-width: 300px;
    }
    .mo-txt {
      width: 66.6666%;
    }
  }

  .mo-small {
    .mo-img {
      width: 20%;
      max-width: 100px;
    }
    .mo-txt {
      width: 80%;
    }
  }

  img {
    display: block;
    max-width: 100%;
    height: auto;
  }
}

// BASE & DEMO STYLES FROM A SYSTEM

* {
  box-sizing: border-box;
}

body {
  --color-white: rgba(255, 255, 255, 1);
  --color-text-heading: rgba(0, 0, 0, 1);

  --color-text-body: rgba(0, 0, 0, 0.7);
  color: rgba(0, 0, 0, 0.7);
  color: var(--color-text-body);

  --color-text-link: rgba(0, 0, 255, 1);
  --color-text-link-hover: rgba(0, 0, 153, 1);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: rgba(0, 0, 0, 1);
  color: var(--color-text-heading);
}

a {
  color: rgba(0, 0, 255, 1);
  color: var(--color-text-link);
  &:hover {
    color: rgba(0, 0, 153, 1);
    color: var(--color-text-link-hover);
  }
}

.button,
button {
  display: inline-block;
  font-family: inherit;
  font-size: inherit;
  background-color: rgba(0, 0, 255, 1);
  background-color: var(--color-text-link);
  border-width: 1px;
  border-style: solid;
  border-color: rgba(0, 0, 255, 1);
  border-color: var(--color-text-link);
  color: white;
  color: var(--color-white);
  padding: 0.5em 1em;
  cursor: pointer;

  &:hover {
    color: white;
    color: var(--color-white);
    background-color: rgba(0, 0, 153, 1);
    background-color: var(--color-text-link-hover);
    border-color: rgba(0, 0, 153, 1);
    border-color: var(--color-text-link-hover);
  }
}

              
            
!

JS

              
                    
              
            
!
999px

Console