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.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Typography Test</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body class="baseline">
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<section id="content" class="wrapper">
<div class="inner">
<article id="post0123123" class="post">
<h1>This is a 1st level Heading</h1>
<h2>This is a 2nd level Heading</h2>
<h3>This is a 3rd level Heading</h3>
<h4>This is a 4th level Heading</h4>
<h5>This is a 5th level Heading</h5>
<h6>This is a 6th level Heading</h6>
<p>The following code was built to help developers test their websites, particularly how type elements line up in relationship to one another. This can be used in combination with a <a href="https://gist.github.com/4277585" title="CSS3 Baseline Grid">baseline grid</a> for more precision. Modified by <a href="http://cwhale.me">Carlos Ballena</a>. My apologies for I can't remember who built this originally, within the content you will find the name Jukka Korpela, after a quick Google search he seems to have a Web Development background so I think it's safe to assume he built it. Regardless, thanks to the creator for his work served as a template to this piece.</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
</hr>
<h1>This is a 1st level Heading</h1>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<h2>This is a 2nd level Heading</h2>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<h3>This is a 3rd level Heading</h3>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<h4>This is a 4th level Heading</h4>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<h5>This is a 5th level Heading</h5>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<h6>This is a 6th level Heading</h6>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
</hr>
<h1>This is a 1st Level Heading</h1>
<p>This is a small test paragraph.</p>
<h2>This is 2nd level heading</h2>
<p>This is a small test paragraph.</p>
<h3>This is 3rd level heading</h3>
<p>This is a small test paragraph.</p>
<h4>This is 4th level heading</h4>
<p>This is a small test paragraph.</p>
<h5>This is 5th level heading</h5>
<p>This is a small test paragraph.</p>
<h6>This is 6th level heading</h6>
<p>This is a small test paragraph.</p>
<div>Basic block level elements</div>
<p>This is a normal paragraph (<code>p</code> element). To add some length to it, let us mention that this page was primarily written for testing the effect of <strong>user style sheets</strong> . You can use it for various other purposes as well, like just checking how your browser displays various HTML elements.</p>
<p>This is another paragraph. I think it needs to be added that the set of elements tested is not exhaustive in any sense. I have selected those elements for which it can make sense to write user style sheet rules, in my opionion.</p>
<div>This is a <code>div</code> element. Authors may use such elements instead of paragraph markup for various reasons. (End of <code>div</code>.)</div>
<blockquote><p>This is a block quotation containing a single paragraph. Well, not quite, since this is not <em>really</em> quoted text, but I hope you understand the point. After all, this page does not use HTML markup very normally anyway.</p></blockquote>
<p>The following contains address information about the author, in an <code>address</code> element.</p>
<address><a href="#">Jukka Korpela</a>, <a href="mailto:jkorpela@cs.tut.fi">jkorpela@cs.tut.fi</a></address>
<h2>Lists</h2>
<p>This is a paragraph before an <strong>unordered</strong> list (<code>ul</code> ). Note that the spacing between a paragraph and a list before or after that is hard to tune in a user style sheet. You can't guess which paragraphs are logically related to a list, e.g. as a "list header".</p>
<ul><li>One.</li>
<li>Two.</li>
<li>Three. Well, probably this list item should be longer. Note that for short items lists look better if they are compactly presented, whereas for long items, it would be better to have more vertical spacing between items.</li>
<li>Four. This is the last item in this list. Let us terminate the list now without making any more fuss about it.</li>
</ul>
<p>This is a paragraph before an <strong>ordered</strong> list (<code>ol</code> ). Note that the spacing between a paragraph and a list before or after that is hard to tune in a user style sheet. You can't guess which paragraphs are logically related to a list, e.g. as a "list header".</p>
<ol>
<li>One.</li>
<li>Two.</li>
<li>Three. Well, probably this list item should be longer. Note that if items are short, lists look better if they are compactly presented, whereas for long items, it would be better to have more vertical spacing between items.</li>
<li>Four. This is the last item in this list. Let us terminate the list now without making any more fuss about it.</li>
</ol>
<h2>Text-level markup</h2>
<ul>
<li><strong>this is highlighted text</strong> (<code>strong</code> markup used)</li>
<li>this is <em>very</em> simple (<code>em</code> markup used for emphasizing a word)</li>
<li><u>underlined</u> text (<code>u</code> markup used)</li>
<li><strike>overstruck</strike> (<code>strike</code> markup used; note: <code>s</code> is a nonstandard synonym for <code>strike</code> )</li>
<li><code>a[i] = b[i] + c[i);</code> (computer code; class <code>code</code> used)</li>
<li>In order to test how subscripts and superscripts (<code>sub</code> and <code>sup</code> markup) work inside running text, we need some dummy text around constructs like x<sub>1</sub> and H<sub>2</sub> O (where subscripts occur). So here is some fill so that you will (hopefully) see whether and how badly the subscripts and superscripts mess u vertical spacing between lines. Now superscripts: M<sup>lle</sup>, 1<sup>st</sup>, and then some mathematical notations: e<sup>x</sup>, sin<sup>2</sup> <em>x</em> , and some nested superscripts (exponents) too: e<sup>x</sup>2 and f(x)<sup>g(x)</sup>a+b+c (where 2 and a+b+c should appear as exponents of exponents).</li>
</ul>
<h2>Links</h2>
<ul>
<li><a href="#">main page</a></li>
<li><a title="Writing Systems and Punctuation" href="http://www.unicode.org/versions/Unicode4.0.0/ch06.pdf">Unicode Standard, chapter 6</a></li>
</ul>
<p>This is a text paragraph that contains some inline links. Generally, inline links (as opposite to e.g. links lists) are problematic from the <a href="#">usability</a> perspective, but they may have use as “incidental”, less relevant links. See the document <a href="#">Links Want To Be Links</a> .</p>
<h2>Tables</h2>
<p>The following table has a caption. The first row and the first column contain table header cells (<code>th</code> elements) only; other cells are data cells (<code>td</code> elements), with <code>align="right"</code> attributes:</p>
<p>Sample table: Areas of the Nordic countries, in sq km</p>
<table style="border-width: ;" summary="Each row names a Nordic country and specifies its total area and land area, in square kilometers"><tbody><tr><th colspan="1" rowspan="1" style="white-space:normal;">Country</th>
<th colspan="1" rowspan="1" style="white-space:normal;">Total area</th>
<th colspan="1" rowspan="1" style="white-space:normal;">Land area</th>
</tr>
<tr>
<th colspan="1" rowspan="1" style="white-space:normal;">Denmark</th>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">43,070</td>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">42,370</td>
</tr>
<tr>
<th colspan="1" rowspan="1" style="white-space:normal;">Finland</th>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">337,030</td>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">305,470</td>
</tr>
<tr>
<th colspan="1" rowspan="1" style="white-space:normal;">Iceland</th>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">103,000</td>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">100,250</td>
</tr>
<tr>
<th colspan="1" rowspan="1" style="white-space:normal;">Norway</th>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">324,220</td>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">307,860</td>
</tr>
<tr>
<th colspan="1" rowspan="1" style="white-space:normal;">Sweden</th>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">449,964</td>
<td align="RIGHT" colspan="1" rowspan="1" style="white-space:normal;">410,928</td>
</tr>
</tbody>
</table>
</hr>
<address><a href="#">Jukka Korpela</a></address>
</article>
</div>
</section>
<footer>
<div class="wrapper">
<p class="rights">Test ©.</p>
</div>
</footer>
</body>
</html>
h1 { font-size: 2em; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, address { margin: 0 0 .75em; }
Also see: Tab Triggers