css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              <p>Resize this frame to see the responsive effect.</p>
<p><i>Restricted width at larger vieweports for demo purposes:</i></p>

<article class="float-hidden-module md-50">
  <h2>The Loneliest Young Star</h2>
  <div class="float-hidden-module__image  float-hidden-module__image--left">
    <img src="https://res.cloudinary.com/andykirk/image/upload/v1488115638/nasa/pia20700.jpg" alt="Artist’s concept shows an unusual celestial object called CX330 " />
  </div>
  <p><b>An unusual celestial object called CX330 was first detected as a source of X-ray light in 2009. It has been launching “jets” of material into the gas and dust around it.</b></p>
  <p>
    <cite>—
      <a href="https://www.nasa.gov/multimedia/imagegallery/iotd.html">NASA</a>
    </cite>
  </p>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</article>

<article class="float-hidden-module">
  <h2>The Loneliest Young Star</h2>
  <div class="float-hidden-module__image  float-hidden-module__image--left">
    <img src="https://res.cloudinary.com/andykirk/image/upload/v1488115638/nasa/pia20700.jpg" alt="Artist’s concept shows an unusual celestial object called CX330 " />
  </div>
  <p><b>An unusual celestial object called CX330 was first detected as a source of X-ray light in 2009. It has been launching “jets” of material into the gas and dust around it.</b></p>
  <p>
    <cite>—
      <a href="https://www.nasa.gov/multimedia/imagegallery/iotd.html">NASA</a>
    </cite>
  </p>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</article>

<p><i>And again with longer content and right-floating for demo purposes:</i></p>

<article class="float-hidden-module md-50">
  <h2>The Loneliest Young Star</h2>
  <div class="float-hidden-module__image  float-hidden-module__image--right">
    <img src="https://res.cloudinary.com/andykirk/image/upload/v1488115638/nasa/pia20700.jpg" alt="Artist’s concept shows an unusual celestial object called CX330 " />
  </div>
  <p><b>An unusual celestial object called CX330 was first detected as a source of X-ray light in 2009. It has been launching “jets” of material into the gas and dust around it.</b></p>
  <p>
    <cite>—
      <a href="https://www.nasa.gov/multimedia/imagegallery/iotd.html">NASA</a>
    </cite>
  </p>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.</p>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</article>

<article class="float-hidden-module">
  <h2>The Loneliest Young Star</h2>
  <div class="float-hidden-module__image  float-hidden-module__image--right">
    <img src="https://res.cloudinary.com/andykirk/image/upload/v1488115638/nasa/pia20700.jpg" alt="Artist’s concept shows an unusual celestial object called CX330 " />
  </div>
  <p><b>An unusual celestial object called CX330 was first detected as a source of X-ray light in 2009. It has been launching “jets” of material into the gas and dust around it.</b></p>
  <p>
    <cite>—
      <a href="https://www.nasa.gov/multimedia/imagegallery/iotd.html">NASA</a>
    </cite>
  </p>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.</p>
  <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</article>
            
          
!
            
              /* Basic common settings: */
$primary-color: rgb(0,20,30);
$secondary-color: rgb(171, 101, 20);
$module-breakpoint: 30em;

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

body {
  font-family: 'Lato', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.4;
  padding: 1rem;
  margin: 0;
}

h2 {
  margin-top: 0;
}

img {
  /* Remove whitespace under images: */
  vertical-align: middle;
}

a {
  color: $secondary-color;
  &:hover {
    color: lighten($secondary-color, 50);
  }
}


/* Double last margin prevention hack. Not intended for production. */
.float-hidden-module p:last-of-type {
  margin-bottom: 0;
}

/*
  Demonstrate container query-esque responsiveness:
*/
@media only screen and (min-width:40em) {
  .md-50 {
    max-width: 50%;
  }
}

/* The pattern: */

.float-hidden-module {
  /* Cosmetics (not part of the pattern): */
  margin-bottom: 1em;
  background: $primary-color;
  color: #fff;
  
  padding: 1em;
}

.float-hidden-module:after {
  content: "";
  display: table;
  clear: both;
}

.float-hidden-module__image {
  width: calc((25em - 100%) * -1000);
  max-width: 50%;
  
  margin-bottom: 1rem;
  
  /* Hide the border when image is collaped: */
  overflow: hidden;
}

.float-hidden-module__image img {
  /* This is the easiest way to create space betweem the image and the text: */
  width: calc(100% - 1em);
  
  /* Cosmetic only: */
  border: 1px solid;
}

.float-hidden-module__image--left {
  float: left;
}

.float-hidden-module__image--right {
  float: right;
  margin-left: 1rem;
}
            
          
!
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.
Loading ..................

Console