HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<h1>Heading 1. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h1>
<h2>Heading 2. In molestie imperdiet gravida. Aliquam at pretium nulla.</h2>
<h3>Heading 3. Nunc imperdiet fringilla eleifend. Sed a nulla massa, vitae hendrerit justo.</h3>
<h4>Heading 4. Suspendisse vulputate tincidunt tincidunt. Etiam tincidunt elit semper quam suscipit.</h4>
<h5>Heading 5. Nam vel imperdiet elit. Maecenas quis feugiat nunc. Donec odio nunc, tincidunt.</h5>
<h6>Heading 6. Phasellus aliquam massa sed odio blandit et condimentum quam commodo.</h6>
<p>This is the first line of the first paragraph. Consectetur adipiscing elit. Donec placerat, augue id tincidunt malesuada, nisl ipsum congue tortor, eleifend cursus massa lectus ut odio. Vestibulum tortor orci, bibendum elementum commodo eu, ultricies a lorem. Nunc congue leo sit amet ante euismod luctus quis et massa. Nulla posuere scelerisque ullamcorper. Suspendisse iaculis ornare nibh sed tincidunt.</p>
<p>This is the second paragraph. Sed faucibus mollis odio, vel mattis velit tincidunt ut. Etiam vitae mauris erat. Quisque at sem nec metus elementum laoreet. Ut ac consectetur lacus. Fusce nulla felis, commodo et hendrerit non, pharetra et sapien. Praesent id urna a augue aliquam pharetra. Donec sed rhoncus massa. Suspendisse rutrum viverra felis. Vestibulum augue lacus, ullamcorper non suscipit nec, ornare et mauris. Proin mattis fermentum nibh quis gravida. Mauris feugiat hendrerit metus, et porta nisl tempus.</p>
<p>Morbi faucibus felis vel sem ultrices quis condimentum odio tincidunt. In id quam id nisi semper laoreet. Nam vehicula, mauris eget sodales accumsan, sapien odio sodales risus, pretium commodo ligula purus in felis. Pellentesque arcu elit, vulputate eget cursus id, auctor eu sem. Praesent at turpis mauris. Nunc enim lacus, euismod sit amet lobortis in, scelerisque consectetur ipsum. Cras sagittis porta neque vitae imperdiet. Morbi sed nunc in felis hendrerit faucibus. Donec pulvinar ligula eu ligula tristique sed commodo velit ultricies. Fusce dui velit, tempus eu rhoncus ac, sodales ac leo. Donec vitae nisl magna. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
<blockquote class="quotes">
This is a blockquote with quotes. Donec sed rhoncus massa. Suspendisse rutrum viverra felis. Vestibulum augue lacus, ullamcorper non suscipit nec, ornare et mauris. Proin mattis fermentum nibh quis gravida.
<cite>Citation</cite>
</blockquote>
<p>Nullam varius nunc et odio condimentum, quis posuere nunc sodales. Ut in ante elit. Maecenas vehicula massa metus, at vulputate felis convallis a. Phasellus venenatis ante at enim condimentum accumsan. Maecenas et mattis massa. In metus mauris, hendrerit posuere lacinia et, pellentesque eu nunc. Nunc eget aliquam tellus. Donec convallis risus nisl, id imperdiet diam commodo in. Donec euismod aliquet mauris at sodales. Vivamus sem erat, scelerisque faucibus fringilla eget, feugiat eget arcu. Morbi faucibus pretium turpis mollis sollicitudin. Suspendisse eget mi tincidunt, ornare ligula vel, mollis dui. Morbi fermentum risus ut lacus suscipit dignissim. Ut sed nisl et nisi suscipit luctus. Praesent id aliquet tellus, non consectetur sapien.</p>
<p>Nam sodales leo eros, a feugiat turpis venenatis sed. Proin at sagittis nunc. Phasellus laoreet libero non diam sagittis adipiscing. Donec tincidunt auctor imperdiet. Nunc in dapibus elit, vel convallis nisi. Morbi et sem non magna euismod pretium. Pellentesque a odio nulla. Integer condimentum posuere ante at convallis. Nullam non egestas velit, at tristique sem. Vestibulum sagittis lacinia ante, ac commodo erat varius ut. Sed eget sem turpis. Vivamus consequat justo aliquam, imperdiet nisl at, pellentesque risus. Curabitur varius pretium urna, nec aliquet libero.</p>
<!--<h2>Images:</h2>
<img src="images/placeholder1.gif" class="baselined" width="288" height="144" alt="placeholder image"/><br>
<img src="images/placeholder1.gif" class="baselined" width="480" height="240" alt="placeholder image"/><br>
<img src="images/placeholder1.gif" class="baselined" width="720" height="360" alt="placeholder image"/>
-->
<p>Aenean elementum nibh ut orci ornare, in hendrerit est blandit. Suspendisse molestie convallis cursus. Integer fringilla condimentum lorem. Curabitur ut ante non massa suscipit porta vel a quam. Donec porttitor vehicula tincidunt. Aliquam feugiat, metus nec pulvinar rhoncus, purus libero viverra sem, sit amet pellentesque turpis nulla quis sapien. Duis placerat ultricies nisi, ac rhoncus nisl laoreet et. Nullam arcu erat, aliquet vel pulvinar ac, bibendum sed sem. Quisque erat enim, egestas eu ligula eget, ullamcorper posuere dolor. Pellentesque varius leo enim, et luctus massa congue at.</p>
<p>Aliquam fringilla vitae ligula quis tempus. Proin pretium et eros in accumsan. Etiam nisi elit, fringilla at orci elementum, vestibulum placerat nibh. Vestibulum accumsan elit quam, sed pharetra purus gravida at. Quisque sagittis, velit ac aliquam imperdiet, quam elit lobortis massa, ut iaculis metus metus a sapien. Duis vitae posuere lorem, at imperdiet arcu. Nulla ut tortor est. Cras condimentum ultrices adipiscing.</p>
<blockquote class="left">
<h6>Heading 6</h6>
This is a left blockquote. Donec sed rhoncus massa. Suspendisse rutrum viverra felis. Vestibulum augue lacus, ullamcorper non suscipit nec, ornare et mauris. Proin mattis fermentum nibh quis gravida.
</blockquote>
<p>Morbi faucibus felis vel sem ultrices quis condimentum odio tincidunt. In id quam id nisi semper laoreet. Nam vehicula, mauris eget sodales accumsan, sapien odio sodales risus, pretium commodo ligula purus in felis. Pellentesque arcu elit, vulputate eget cursus id, auctor eu sem. Praesent at turpis mauris. Nunc enim lacus, euismod sit amet lobortis in, scelerisque consectetur ipsum. Cras sagittis porta neque vitae imperdiet. Morbi sed nunc in felis hendrerit faucibus. Donec pulvinar ligula eu ligula tristique sed commodo velit ultricies. Fusce dui velit, tempus eu rhoncus ac, sodales ac leo. Donec vitae nisl magna. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
<p>Nullam varius nunc et odio condimentum, quis posuere nunc sodales. Ut in ante elit. Maecenas vehicula massa metus, at vulputate felis convallis a. Phasellus venenatis ante at enim condimentum accumsan. Maecenas et mattis massa. In metus mauris, hendrerit posuere lacinia et, pellentesque eu nunc. Nunc eget aliquam tellus. Donec convallis risus nisl, id imperdiet diam commodo in. Donec euismod aliquet mauris at sodales. Vivamus sem erat, scelerisque faucibus fringilla eget, feugiat eget arcu. Morbi faucibus pretium turpis mollis sollicitudin. Suspendisse eget mi tincidunt, ornare ligula vel, mollis dui. Morbi fermentum risus ut lacus suscipit dignissim. Ut sed nisl et nisi suscipit luctus. Praesent id aliquet tellus, non consectetur sapien.</p>
<p>Nam sodales leo eros, a feugiat turpis venenatis sed. Proin at sagittis nunc. Phasellus laoreet libero non diam sagittis adipiscing. Donec tincidunt auctor imperdiet. Nunc in dapibus elit, vel convallis nisi. Morbi et sem non magna euismod pretium. Pellentesque a odio nulla. Integer condimentum posuere ante at convallis. Nullam non egestas velit, at tristique sem. Vestibulum sagittis lacinia ante, ac commodo erat varius ut. Sed eget sem turpis. Vivamus consequat justo aliquam, imperdiet nisl at, pellentesque risus. Curabitur varius pretium urna, nec aliquet libero.</p>
<blockquote class="right">
This is a right blockquote. Donec sed rhoncus massa. Suspendisse rutrum viverra felis. Vestibulum augue lacus, ullamcorper non suscipit nec, ornare et mauris. Proin mattis fermentum nibh quis gravida.
</blockquote>
<p>Aenean elementum nibh ut orci ornare, in hendrerit est blandit. Suspendisse molestie convallis cursus. Integer fringilla condimentum lorem. Curabitur ut ante non massa suscipit porta vel a quam. Donec porttitor vehicula tincidunt. Aliquam feugiat, metus nec pulvinar rhoncus, purus libero viverra sem, sit amet pellentesque turpis nulla quis sapien. Duis placerat ultricies nisi, ac rhoncus nisl laoreet et. Nullam arcu erat, aliquet vel pulvinar ac, bibendum sed sem. Quisque erat enim, egestas eu ligula eget, ullamcorper posuere dolor. Pellentesque varius leo enim, et luctus massa congue at.</p>
<p>Aliquam fringilla vitae ligula quis tempus. Proin pretium et eros in accumsan. Etiam nisi elit, fringilla at orci elementum, vestibulum placerat nibh. Vestibulum accumsan elit quam, sed pharetra purus gravida at. Quisque sagittis, velit ac aliquam imperdiet, quam elit lobortis massa, ut iaculis metus metus a sapien. Duis vitae posuere lorem, at imperdiet arcu. Nulla ut tortor est. Cras condimentum ultrices adipiscing.</p>
<h2>Lists:</h2>
<p>This is an unordered list:</p>
<ul>
<li>List Item</li>
<li>List Item
<ul>
<li>Nested List Item</li>
<li>Nested List Item</li>
<li>Nested List Item</li>
</ul>
</li>
<li>List Item
<ol>
<li>Nested List Item</li>
<li>Nested List Item</li>
<li>Nested List Item</li>
</ol></li>
<li>List Item</li>
</ul>
<p>This is an ordered list:</p>
<ol>
<li>List Item</li>
<li>List Item
<ul>
<li>Nested List Item</li>
<li>Nested List Item</li>
<li>Nested List Item</li>
</ul>
</li>
<li>List Item
<ol>
<li>Nested List Item</li>
<li>Nested List Item</li>
<li>Nested List Item</li>
</ol></li>
<li>List Item</li>
</ol>
<p><a href="#">This is a link</a>.</p>
/* CSS RESET
------------------------------------*/
* {
margin: 0;
padding: 0;
}
/* #BASE TYPOGRAPHY
================================================== */
/*
=================================================
Basic text sizing
=================================================
Base/main font size for paragraph/body text
Reference
62.5% => 10px
68.8% => 11px
75% => 12px
81.3% => 13px
87.5% => 14px
100% => 16px (Default)
112.5% => 18px
125% => 20px
*/
/* #Body */
body {
font-family: Helvetica, Arial, sans-serif;
/*font-family: Georgia, serif;*/
font-size: 100%; /* 16px; */
line-height: 1.5em /* 24px; */
}
/* #Headings
Using a Traditional scale: 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 21, 24, 36, 48, 60, 72
Starting with 48, if base is 16:
h1 = 48 pixels → 48 ÷ 16 = 3 em
h2 = 36 pixels → 36 ÷ 16 = 2.25 em
h3 = 24 pixels → 24 ÷ 16 = 1.5 em
h4 = 21 pixels → 21 ÷ 16 = 1.3125 em
h5 = 18 pixels → 18 ÷ 16 = 1.125 em
h6 = 16 pixels → 16 ÷ 16 = 1 em
*/
h1, h2, h3, h4, h5, h6 {
/*font-family: Helvetica, Arial, sans-serif;*/
}
/* em-based w/ baseline */
h1 { font-size: 3em; line-height: 1em; margin-bottom: .45em; padding-top: .05em; }
h2 { font-size: 2.25em; line-height: 1.3334em; margin-bottom: .51em; padding-top: .15em; }
h3 { font-size: 1.5em; line-height: 1.5em; margin-bottom: .4em; padding-top: .125em; }
h4 { font-size: 1.3125em; line-height: 1.75em; margin-bottom: .95em; padding-top: .2em; }
h5 { font-size: 1.125em; line-height: 1.35em; margin-bottom: .7em; }
h6 { font-size: 1em; line-height: 1.5em; margin-bottom: 0em; }
/* #Paragraphs
================================================== */
p {
margin-bottom: 1.5em;
}
/* #Links
================================================== */
a { color: #39c; text-decoration: none; }
a:visited, a:hover, a:focus { color: #069; }
/* #Lists
================================================== */
ul, ol {
margin: 0 0 1.5em 0;
}
ul li ul, ul li ol, ol li ul, ol li ol {
margin: 0;
}
li {
margin: 0 0 0 1.875em;
}
/* #Images
================================================== */
img.baselined {
border: 0px solid red;
margin-top: .2333em;
margin-bottom: .1em;
}
a img {
border: none;
}
/* #Block Quotes
================================================== */
/* #Block Quotes
================================================== */
blockquote {
position: relative;
margin: 1.5em 0;
padding: 1.5em;
color: #966;
}
blockquote.quotes {
padding: 1.5em 4em 1.5em 4em;
}
blockquote.quotes:before {
display: block;
content: "\201C";
font-size: 4em;
position: absolute;
top: .6em;
left: .3em;
color: #ddd;
}
blockquote.quotes:after {
display: block;
content: "\201D";
font-size: 4em;
position: absolute;
bottom: .4em;
right: .3em;
color: #ddd;
}
blockquote cite {
color: #999;
font-size: .875em;
display: block;
text-align: right;
}
blockquote cite:before {
content: "\2014 \2009";
}
blockquote.left {
width: 23%;
float: left;
margin: 0 1em .5em 0;
border-right: 1px solid #ccc;
text-align: right;
}
blockquote.right {
width: 23%;
float: right;
margin: 0 0 .5em 1em;
border-left: 1px solid #ccc;
}
/* Site-specific Styling */
body {
background: url(http://nma.kcc.hawaii.edu/gargiulo/tests/baseline/images/baseline-12.gif);
padding: 1.9em;
color: #333;
}
body:hover {
}
Also see: Tab Triggers