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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <div class="holder">
  <div class="parent">
    <div class="s600px">I am blue and under 600px wide.</div>
    <div class="s601px">I am red and over 600px wide.</div>
  </div>
</div>
            
          
!
            
              @import "compass/css3";

*, 
*:before, 
*:after {
  -moz-box-sizing: border-box; 
  -webkit-box-sizing: border-box; 
  box-sizing: border-box;
}
body, 
html { 
  margin:0; 
  padding:0;
  font-family: helvetica, sans-serif;
}
// *** Test begins here - change the html or change the body - MQs remain 16px based ***
html { 
  font-size: 100%; // This is what we want to change - 100% is 16px by default
}
body { 
  font-size: 1rem; // This is whatever base we've set the html element to be
}
.holder { height:100%; }
.parent { 
  height:50%; 
  min-height: 550px; 
  position:relative; 
  background: blue; 
  padding: 100px;
}
.s600px,
.s601px {
  padding: 25px;
  background: black;
  color: white; 
  text-align: center;
}
// At 16px, 37.5em should be 600px
// If HTML is set at 200%, and body is 1rem, how is the MQ holding on to a 16px multiplier?
@media only screen and (max-width: 37.5em) {
  .s600px { 
    display: block;
  }
  .s601px {
    display: none;
  }
}
@media only screen and (min-width: 37.5em) {
  .s601px { 
    display: block;
  }
  .s600px {
    display: none;
  }
  .parent {
    background: red;
  }
}
// And the answer is - USER SETTINGS!! Authors have no control.
            
          
!
999px
Loading ..................

Console