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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <h1>This is a responsive typography demo</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dictum quam gravida ultrices ultrices. Maecenas ut fermentum ex. Nunc varius mollis ex ac luctus.</p>
<p class="hidden-md highlight">This is hidden on larger displays.</p>
<p class="visible-lg highlight">This is shown only on larger displays.</p>
<p>Nullam vitae tincidunt tellus, in luctus ipsum. Nullam et fringilla justo. Donec aliquet tellus auctor magna scelerisque, ut ultrices ipsum efficitur. Praesent semper risus sit amet augue pharetra, quis fermentum elit tincidunt. Cras luctus et sem id feugiat.</p>
<h2>Heading 2 Example</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dictum quam gravida ultrices ultrices. Maecenas ut fermentum ex. Nunc varius mollis ex ac luctus. Nullam vitae tincidunt tellus, in luctus ipsum. Nullam et fringilla justo. Donec aliquet tellus auctor magna scelerisque, ut ultrices ipsum efficitur. Praesent semper risus sit amet augue pharetra, quis fermentum elit tincidunt. Cras luctus et sem id feugiat.</p>
<h3>Heading 3 Example</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dictum quam gravida ultrices ultrices. Maecenas ut fermentum ex. Nunc varius mollis ex ac luctus.</p>

<img src="http://lorempixel.com/800/400/" class="img-responsive" />

<p>Nullam vitae tincidunt tellus, in luctus ipsum. Nullam et fringilla justo. Donec aliquet tellus auctor magna scelerisque, ut ultrices ipsum efficitur. Praesent semper risus sit amet augue pharetra, quis fermentum elit tincidunt. Cras luctus et sem id feugiat.</p>
<h4>Heading 4 Example</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dictum quam gravida ultrices ultrices. Maecenas ut fermentum ex. Nunc varius mollis ex ac luctus. Nullam vitae tincidunt tellus, in luctus ipsum. Nullam et fringilla justo. Donec aliquet tellus auctor magna scelerisque, ut ultrices ipsum efficitur. Praesent semper risus sit amet augue pharetra, quis fermentum elit tincidunt. Cras luctus et sem id feugiat.</p>
            
          
!
            
              /* Common base styles for all devices */

body {
  font-size: 14px;
  line-height: 1.57em;
  font-family: georgia
}

body:after {
  content: 'Size: Mobile below 480px';
  background: yellow;
  padding: 0.25em
}

h1 {
  font-size: 2em
}

h2 {
  font-size: 1.5em
}

h3 {
  font-size: 1.25em
}

h4,
p {
  font-size: 1em
}

.img-responsive {
  max-width: 100%;
  height: auto
}

.hidden-xs,
.visible-sm,
.visible-md,
.visible-lg {
  visibility: hidden;
  display: none
}

.highlight { 
  background-color:yellow;
}

@media only screen and (min-width: 480px) {
  /* Styles for wide mobiles (480px) and above */
  .hidden-sm {
    visibility: hidden;
    display: none
  }
  .visible-sm {
    visibility: visible;
    display: block
  }
  body:after {
    content: 'Size: Wide mobile 480px and up';
  }
}

@media only screen and (min-width: 768px) {
  /* Styles for tablets/netbooks (768px) and up */
  body {
    font-size: 16px
  }
  .hidden-md {
    visibility: hidden;
    display: none
  }
  .visible-md {
    visibility: visible;
    display: block
  }
  body:after {
    content: 'Size: Tablets 768px and up';
  }
}

@media only screen and (min-width: 1024px) {
  /* Styles for large screens (desktops 1024px) and above */
  body {
    font-size: 20px
  }
  .hidden-lg {
    visibility: hidden;
    display: none
  }
  .visible-lg {
    visibility: visible;
    display: block
  }
  body:after {
    content: 'Size: Desktop 1024 and up';
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console