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

              
                <div class="wrap">
  <div class="c240">
    This is <span>240px</span> screen size or more, but less than 320px.
  </div>
  <div class="c320">
    This is <span>320px</span> screen size or more, but less than 480px.
  </div>
  <div class="c480">
    This is <span>480px</span> screen size or more, but less than 768px.
  </div>
  <div class="c768">
    This is <span>768px</span> screen size or more, but less than 1024px.
  </div>
  <div class="c1024">
    This is <span>1024px</span> screen size or more, but less than 1140px.
  </div>
  <div class="c1140">
    This is <span>1140px</span> screen size or more, but less than 1280px.
  </div>
  <div class="c1280">
    This is <span>1280px</span> screen size or more, but less than 1500px.
  </div>
  <div class="c1500">
    This is <span>1500px</span> screen size or more.
  </div>
</div>























<!-- Follow me on Twitter -->
<a class="twitter" target="_top" href="https://twitter.com/MrAhmadAwais"><svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72"><path d="M67.812 16.141a26.246 26.246 0 0 1-7.519 2.06 13.134 13.134 0 0 0 5.756-7.244 26.127 26.127 0 0 1-8.313 3.176A13.075 13.075 0 0 0 48.182 10c-7.229 0-13.092 5.861-13.092 13.093 0 1.026.118 2.021.338 2.981-10.885-.548-20.528-5.757-26.987-13.679a13.048 13.048 0 0 0-1.771 6.581c0 4.542 2.312 8.551 5.824 10.898a13.048 13.048 0 0 1-5.93-1.638c-.002.055-.002.11-.002.162 0 6.345 4.513 11.638 10.504 12.84a13.177 13.177 0 0 1-3.449.457c-.846 0-1.667-.078-2.465-.231 1.667 5.2 6.499 8.986 12.23 9.09a26.276 26.276 0 0 1-16.26 5.606A26.21 26.21 0 0 1 4 55.976a37.036 37.036 0 0 0 20.067 5.882c24.083 0 37.251-19.949 37.251-37.249 0-.566-.014-1.134-.039-1.694a26.597 26.597 0 0 0 6.533-6.774z"></path></svg></a>
              
            
!

CSS

              
                /**
 * MIXIN: Responsive Media Queries.
 *
 * Creates responsive media queries for seven different screen sizes.
 * These are based on min-width which means if x is the size then your
 * CSS will affect any device with screen width x and above.
 *
 * USAGE: 
 *	@include r(240)  { }
 *	@include r(320)  { }
 *	@include r(480)  { }
 *	@include r(768)  { }
 *	@include r(1024) { }
 *	@include r(1140) { }
 *	@include r(1280) { }
 *  @include r(1500) { }
 *
 * CSS content goes inside {} brackets. These mixins should be used inside
 * a class definition. For example:
 *
 * The following CSS will hide the .header on screen width 320px and above.
 * .header {
 * 	  @include r(320)  { display: none; }
 * }
 *
 * @author Ahmad Awais (https://github.com/ahmadawais)
 */
@mixin r( $point ) {
	@if $point==240 {
		@media ( min-width: 240px ) {
			@content;
		}
	}
	@if $point==320 {
		@media ( min-width: 320px ) {
			@content;
		}
	}
	@if $point==480 {
		@media ( min-width: 480px ) {
			@content;
		}
	}
	@if $point==600 {
		@media ( min-width: 600px ) {
			@content;
		}
	}
	@if $point==768 {
		@media ( min-width: 768px ) {
			@content;
		}
	}
	@if $point==1024 {
		@media ( min-width: 1024px ) {
			@content;
		}
	}
	@if $point==1140 {
		@media ( min-width: 1140px ) {
			@content;
		}
	}
	@if $point==1280 {
		@media ( min-width: 1280px ) {
			@content;
		}
	}
	@if $point==1500 {
		@media ( min-width: 1500px ) {
			@content;
		}
	}
}

/* global box-sizing */
*,
*:after,
*:before {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* html element 62.5% font-size for REM use */
html {
    font-size: 62.5%;
    height:100%;
    min-height:100%;
}

body {
    font: 400 11px/1.4 sans-serif;
    margin: 0;
    height:100%;
    min-height:100%;
    word-break: break-word;
    -webkit-word-break: break-word;
}

// Example styling.
.wrap {
  display: table;
  width: 100%;
  font-family: 'Playfair Display', serif;
  margin: 0 auto;
  text-align: center;
  background: white;
  color: black;

  div {
    display: table-cell;
    width: 100%;
    height: 100vh;
    vertical-align: middle;
    font-size: 5vw;
    padding: 5vw;
    
    span {
      background: rgba(0, 0, 0, 0.1);
      padding: 0.3rem 1rem;
      font-style: italic;
    }
  }
  
  // Display the div on a particular screen size and above.
  .c240 { 
    display: none;
    @include r(240)  { display: table-cell; }
    @include r(320)  { display: none; }
  }
  .c320 { 
    display: none;
    @include r(320)  { display: table-cell; }
    @include r(480)  { display: none; }
  }
  .c480 { 
    display: none;
    @include r(480)  { display: table-cell; }
    @include r(768)  { display: none; }
  }
  .c768 { 
    display: none;
    @include r(768)  { display: table-cell; }
    @include r(1024)  { display: none; }
  }
  .c1024 {
    display: none;
    @include r(1024)  { display: table-cell; }
    @include r(1140)  { display: none; }
  }
  .c1140 {
    display: none;
    @include r(1140)  { display: table-cell; }
    @include r(1280)  { display: none; }
  }
  .c1280 {
    display: none;
    @include r(1280)  { display: table-cell; }
    @include r(1500)  { display: none; }
  }
  .c1500 {
    display: none;
    @include r(1500)  { display: table-cell; }
  }
  
  // Here we use the mixin inside the .wrap div.
  @include r(240)  { background: beige; }
  @include r(320)  { background: orange; }
  @include r(480)  { background: orangered; }
  @include r(768)  { background: royalblue; }
  @include r(1024) { background: gold; }
  @include r(1140) { background: khaki; }
  @include r(1280) { background: thistle; }
  @include r(1500) { background: tomato; }
}





























// [IGNORE] DEMO CSS BELOW.
.twitter {
	position: fixed;
	display: block;
	right: 12px;
	bottom: 12px;
	svg {
		width: 32px;
		height: 32px;
		fill: #1da1f2;
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console