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

              
                <h1>CSS Chassis</h1>

<hr>

<h1>Heading 1 &lt;h1&gt;</h1>
<h2>Heading 2 &lt;h2&gt;</h2>
<h3>Heading 3 &lt;h3&gt;</h3>
<h4>Heading 4 &lt;h4&gt;</h4>
<h5>Heading 5 &lt;h5&gt;</h5>
<h6>Heading 6 &lt;h6&gt;</h6>

<hr>

<h1>Heading 1 &lt;h1&gt;</h1>
<p>Many say exploration is part of our destiny, but it’s actually our duty to future generations and their quest to ensure the survival of the human species.</p>

<h2>Heading 2 &lt;h2&gt;</h2>
<p>It suddenly struck me that that tiny pea, pretty and blue, was the Earth. I put up my thumb and shut one eye, and my thumb blotted out the planet Earth. I didn't feel like a giant. I felt very, very small.</p>

<h3>Heading 3 &lt;h3&gt;</h3>
<p>The Earth was small, light blue, and so touchingly alone, our home that must be defended like a holy relic. The Earth was absolutely round. I believe I never knew what the word round meant until I saw Earth from space.</p>

<h4>Heading 4 &lt;h4&gt;</h4>
<p>To be the first to enter the cosmos, to engage, single-handed, in an unprecedented duel with nature—could one dream of anything more?</p>

<h5>Heading 5 &lt;h5&gt;</h5>
<p>What was most significant about the lunar voyage was not that man set foot on the Moon but that they set eye on the earth.</p>

<h6>Heading 6 &lt;h6&gt;</h6>
<p>Many say exploration is part of our destiny, but it’s actually our duty to future generations and their quest to ensure the survival of the human species.</p>

<hr>

<h2>Block-level elements</h2>

<p>Here's a paragraph &lt;p&gt; filled with some <a href="http://spaceipsum.com/" target="_blank">Space Ipsum</a>. Never in all their history have men been able truly to conceive of the world as one: a single sphere, a globe, having the qualities of a globe, a round earth in which all the directions eventually meet, in which there is no center because every point, or none, is center — an equal earth which all men occupy as equals. The airman's earth, if free men make it, will be truly round: a globe in practice, not in theory.</p>

<p>There can be no thought of finishing for ‘aiming for the stars.’ Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.</p>

<div>Here's a div &lt;div&gt;. A Chinese tale tells of some men sent to harm a young girl who, upon seeing her beauty, become her protectors rather than her violators. That's how I felt seeing the Earth for the first time. I could not help but love and cherish her
</div>

<article>
  <h3>This is an article &lt;article&gt; with a paragraph</h3>
  <p>We want to explore. We’re curious people. Look back over history, people have put their lives at stake to go out and explore … We believe in what we’re doing. Now it’s time to go.</p>
  <p>End of the article.</p>
</article>

<blockquote>Let's light this fire one more time, Mike, and witness this great nation at its best. &lt;blockquote&gt; via <a href="http://spaceipsum.com/" target="_blank">Space Ipsum</a></blockquote>

<p>We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win.</p>

<pre>
* {
   font-family: 'Comic Sans MS', 'Comic Sans', 'Marker Felt' !important;
}
&lt;pre&gt;
</pre>

<p>Many say exploration is part of our destiny, but it’s actually our duty to future generations and their quest to ensure the survival of the human species.</p>

<address>
  <strong>Sherlock Holmes</strong><br>
  221B Baker Street<br>
  London, United Kingdom &lt;address&gt;
</address>

<hr>

<h2>Lists &lt;li&gt;</h2>
<p>The regret on our side is, they used to say years ago, we are reading about you in science class. Now they say, we are reading about you in history class.</p>

<ul>
  <li>Unordered list &lt;ul&gt;</li>
  <li>List element</li>
  <li>Across the sea of space, the stars are other suns.</li>
  <li>Science cuts two ways, of course; its products can be used for both good and evil. But there's no turning back from science. The early warnings about technological dangers also come from science.</li>
</ul>

<p>It suddenly struck me that that tiny pea, pretty and blue, was the Earth. I put up my thumb and shut one eye, and my thumb blotted out the planet Earth. I didn't feel like a giant. I felt very, very small.</p>

<ol>
  <li>Ordered list &lt;ol&gt;</li>
  <li>List element</li>
  <li>The dreams of yesterday are the hopes of today and the reality of tomorrow.</li>
  <li>Curious that we spend more time congratulating people who have succeeded than encouraging people who have not.</li>
</ol>

<p>For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us.</p>

<dl>
  <dt>Definition term &lt;dt&gt;</dt>
  <dd>Definition &lt;dd&gt;</dd>
  <dt>Earth</dt>
  <dd>A kick-ass planet.</dd>
  <dt>Pluto</dt>
  <dd>A kick-ass former planet.</dd>
  <dt>Space Ipsum</dt>
  <dd>NASA is not about the ‘Adventure of Human Space Exploration’…We won’t be doing it just to get out there in space – we’ll be doing it because the things we learn out there will be making life better for a lot of people who won’t be able to go.</dd>
</dl>

<p>Spaceflights cannot be stopped. This is not the work of any one man or even a group of men. It is a historical process which mankind is carrying out in accordance with the natural laws of human development.</p>

<hr>

<h2>Text-level elements</h2>

<ul>
  <li><a href="#">anchor link</a> &lt;a&gt;</li>
  <li>abbreviation: <abbr title="Syntactically Awesome Stylesheets">SASS</abbr> &lt;abbr&gt;</li>
  <li><b>bold</b> &lt;b&gt;</li>
  <li>citation: <cite>A Study in Scarlet</cite> &lt;cite&gt;</li>
  <li>code: <code>&lt;-- @include _hammer --&gt;</code> &lt;code&gt;</li>
  <li>deleted text: <del>Episodes I, II, III</del> &lt;del&gt;</li>
  <li>definition: The <dfn>definition element</dfn> is the element being defined inline. &lt;dfn&gt;</li>
  <li><em>emphasis</em> &lt;em&gt;</li>
  <li><i>italic</i> &lt;i&gt;</li>
  <li><ins>inserted text</ins> &lt;ins&gt;</li>
  <li>keyboard input: <kbd>control + space</kbd> &lt;kbd&gt;</li>
  <li><mark>mark element</mark> &lt;mark&gt;</li>
  <li>meter: <meter min="200" max="500" value="423">awesomeness</meter> &lt;meter&gt;</li>
  <li>progress: <progress value="90" max="100">70 %</progress> &lt;progress&gt;</li>
  <li>quotation (short): <q>You just gotta believe!</q> &lt;q&gt;</li>
  <li>quotation within a quotation (short): <q>Yo dawg, I heard you like quotes so I put <q>this quote</q> within this quote.</q> &lt;q&gt;</li>
  <li>strikethough: <s>Lance Armstrong remains steroid-free.</s> &lt;s&gt;</li>
  <li>sample text: <samp>Error</samp> &lt;samp&gt;</li>
  <li>small: <small>Hydrogen</small> &lt;small&gt;</li>
  <li>small within small: <small>Hydrogen <small>Hydrogen</small></small> &lt;small&gt;</li>
  <li>strong: <strong>The Hammer</strong> &lt;strong&gt;</li>
  <li>subscript: <sub>Lower</sub> 0<sub>1<sub>2<sub>3</sub></sub></sub> &lt;sub&gt;</li>
  <li>superscript: I need a good <sup>superman</sup> joke to go here. 0<sup>1<sup>2<sup>3</sup></sup></sup> &lt;sup&gt;</li>
  <li>time: <time datetime="1985-12-09 19:00">Dec 9</time> &lt;time&gt;</li>
  <li>underline: Never underline <u>anything</u>. &lt;u&gt;</li>
  <li>variable: <var>cat</var> + <var>dog</var> = <var>catdog</var> &lt;var&gt;</li>
</ul>
<hr>

              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,400italic,700italic);


// Em conversion function
@function em($value, $context: $body) {
	@return ($value / $context * 1em);
}


// Uses perfect fifths modular scale
// Primary: 20
// Secondary: 16
// Multiplier: 1.5
// http://modularscale.com/scale/?px1=20&px2=16&ra1=1.5&ra2=0


// Easier way to see/edit values
$body:  20px;

$h1: 67px; // 54 works nicely, as well
$h2: 36px;
$h3: 30px;
$h4: 24px;
$h5: 20px;
$h6: 16px;


body {
  max-width: 700px;
  margin: 3em auto;
  padding: 0 1em;
  font: 400 #{$body}/1.5 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  
  @media ( max-width: 800px ) {
    font-size: 16px;
  }
  @media ( max-width: 500px ) {
    font-size: 14px;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1;
  
  &:after {
    color: #ccc;
    font-size: 12px;
    font-weight: 400;
  }
}

h1 {
  font-size: em($h1);
  font-weight: 700;
  
  &:after {
    content: ' #{$h1}'
  }
}

h2 {
  font-size: em($h2);
  
  &:after {
    content: ' #{$h2}'
  }
}

h3 {
  font-size: em($h3);
  
  &:after {
    content: ' #{$h3}'
  }
}

h4 {
  font-size: em($h4);
  
  &:after {
    content: ' #{$h4}'
  }
}

h5 {
  font-size: em($h5);
  
  &:after {
    content: ' #{$h5}'
  }
}

h6 {
  font-size: em($h6);
  text-transform: uppercase;
  
  &:after {
    content: ' #{$h6}'
  }
}

// Shows body font size;
p {
  &:after {
    content: ' #{$body}';
    color: #ccc;
    font-size: 12px;
  }
}


// Block-level elements

hr {
  border: 0;
  border-bottom: 1px solid #999;
}

blockquote {
  margin: 0;
  padding-left: 1em;
  position: relative;
  border-left: 4px solid #eee;
  font-style: italic;
}

pre {
  padding: 16px 20px;
  background: #f7f7f7;
  font: normal 12px/1.4 Consolas, "Andale Mono", Menlo, Courier, monospace;
}

// Lists

li {}

dt {
  font-weight: 600;
}

dd {
  margin: 0;
}


// Text-level elements
a {
  color: inherit;
  text-decoration: none;

  // Medium text single-pixel underline hack
  background-image: linear-gradient(to bottom, rgba(0,0,0,0) 75%, #000 50%);
  background-repeat: repeat-x;
  background-size: 2px 2px;
  background-position: 0 1.056em; // ~19/18

  @media not all, only screen and (min-resolution: 2dppx), only screen and (-webkit-min-device-pixel-ratio: 2) {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0) 75%, #000 75%);
    background-repeat: repeat-x;
  }
}

b,
strong {
  font-weight: 700;
}
              
            
!

JS

              
                
              
            
!
999px

Console