cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <h1>MQ-less</h1>
<p>Original idea from <a href="https://medium.com/@hteumeuleu">Rémi Parmentier</a> (I'm just duplicating styles one level up), see:</p>
<ul>
  <li>
    <a href="https://medium.freecodecamp.com/the-fab-four-technique-to-create-responsive-emails-without-media-queries-baf11fdfa848#.vuk56496i">The Fab Four technique to create Responsive Emails without Media Queries</a>
  </li>
  <li>
    <a href="http://www.hteumeuleu.fr/wp-content/uploads/2016/02/cq-usecases.html">Element Queries with calc(), width, min-width and max-width</a>
  </li>
</ul>
<p>A convention could be to write the 3 declarations in this order (to help understand which value will be applied in relation to the "BP"):</p>
<pre>
  min-width: /* value to be used above the "breakpoint" */
  width:     /* calc() func containing the "breakpoint" */
  max-width: /* value to be used below the "breakpoint" */
</pre>

<!-- markup from http://www.hteumeuleu.fr/wp-content/uploads/2016/02/cq-usecases.html -->
<div class="grid">
  <div class="column">
    <div class="media">
      <div class="media-img">
        <img src="https://placeholdit.imgix.net/~text?w=130&h=90" alt="" />
      </div>
      <div class="media-body">
        <h1>Lorem Ipsum Dolor Sit Amet</h1>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero corporis quia eos temporibus.
        </p>
      </div>
    </div>
  </div>
  <div class="column">
    <div class="media">
      <div class="media-img">
        <img src="https://placeholdit.imgix.net/~text?w=130&h=90" alt="" />
      </div>
      <div class="media-body">
        <h1>Lorem Ipsum Dolor Sit Amet</h1>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero corporis quia eos temporibus.
        </p>
      </div>
    </div>
  </div>
  <div class="column">
    <div class="media">
      <div class="media-img">
        <img src="https://placeholdit.imgix.net/~text?w=130&h=90" alt="" />
      </div>
      <div class="media-body">
        <h1>Lorem Ipsum Dolor Sit Amet</h1>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero corporis quia eos temporibus.
        </p>
      </div>
    </div>
  </div>
  <div class="column">
    <div class="media">
      <div class="media-img">
        <img src="https://placeholdit.imgix.net/~text?w=130&h=90" alt="" />
      </div>
      <div class="media-body">
        <h1>Lorem Ipsum Dolor Sit Amet</h1>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero corporis quia eos temporibus.
        </p>
      </div>
    </div>
  </div>
</div>
            
          
!
            
              /* 99.99% CSS from http://www.hteumeuleu.fr/wp-content/uploads/2016/02/cq-usecases.html */

body {
  font: 1em/1.25 sans-serif;
  background: #fff;
}

.title,
.intro {
  margin: 0;
  padding: 5px 5px 0;
}

.title small {
  font-size: 0.5em;
  font-weight: normal;
  color: #aaa;
}

.grid {
  margin-top: 20px;
  font-size: 0;
  text-align: center;
}

.column {
  display: inline-block;
  vertical-align: top;
  min-width: 25%;  /* value to use above 900px */
  width: calc((900px - 100%) * 900); /* 900px "breakpoint" */
  max-width: 100%; /* value to use below 900px */
  text-align: left;
  padding: 5px;
  box-sizing: border-box;
}

.media {
  padding: 0 0 10px;
  font-size: 0;
  background: #fbfbfb;
  border: 1px solid #cfcfcf;
}

.media img {
  display: block;
  width: 100%;
  height: auto;
}

.media h1 {
  margin: 0 0 10px;
  font-size: 1.125rem;
}

.media p {
  margin: 0;
  font-size: 1rem;
}

.media-body,
.media-img {
  display: inline-block;
  min-width: 50%; /* value to use above 400px */
  width: calc((400px - 100%) * 400); /* 400px "breakpoint" */
  max-width: 100%; /* value to use below 400px */
  vertical-align: top;
  padding: 10px 10px 0;
  box-sizing: border-box;
}
            
          
!
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