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 URL's 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 it's URL and the proper URL extention.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<article>
<h1>CH and EX units are great for styling typography</h1>
<p>The <sup>superscript</sup> and <sub>subscript</sub> elements have always both been a bit tricky to style until the EX unit came along. Limiting your line-lengths with CH units is super handy, too!</p>
<p>Lorem ipsum dolor sit amet, sint ad proident aliqua. Sunt pariatur eu Lorem esse irure nulla anim laborum esse esse non do laborum duis culpa incididunt. Qui in qui ad quis commodo elit ut culpa mollit exercitation veniam reprehenderit ullamco deserunt incididunt in aute enim ad.
Qui cupidatat sunt adipisicing.</p>
<p>Sint est sint dolore laboris deserunt ullamco cillum. Esse tempor anim ipsum laborum Lorem nostrud ut. Velit laboris ad ad in nostrud veniam mollit ullamco labore. Pariatur ad excepteur consequat duis sint amet anim excepteur culpa. Deserunt non consectetur consectetur amet ullamco non ex enim esse et.
Reprehenderit ea elit esse qui velit in et quis veniam. Non id excepteur voluptate do anim commodo occaecat duis. Sunt occaecat laboris magna. Nulla consequat sunt deserunt exercitation exercitation sint sit est aute aliqua mollit laboris exercitation amet culpa mollit elit mollit est. Magna est consectetur irure ipsum nulla aliqua commodo pariatur laboris ipsum ad ad ullamco excepteur ad sint.
Anim in est exercitation culpa officia pariatur.</p>
<p>Exercitation consequat nulla dolore excepteur anim Lorem sunt incididunt nisi ut. Amet aute officia id. Et elit aliqua ea elit irure do. In dolore ad officia est do aute ullamco irure adipisicing aliqua. Adipisicing sit irure laborum voluptate sunt voluptate non deserunt amet esse sint dolor aliqua laboris non qui. Occaecat ullamco do nisi cillum aliqua commodo dolore. Do quis anim velit ipsum eu labore voluptate anim voluptate quis culpa laboris ut officia.
Adipisicing ipsum deserunt ex aliqua sint est esse pariatur do eu elit sit. Eiusmod ex labore laboris nisi et enim quis nulla occaecat eiusmod. Sint commodo laboris anim elit duis occaecat laboris proident laboris labore laboris et amet reprehenderit nisi id laboris. Sit ullamco cupidatat nulla tempor dolor irure est elit non. Ad veniam laboris duis minim consectetur qui sint cillum nulla nulla qui magna Lorem. Incididunt labore irure veniam in incididunt. Quis non commodo Lorem id sunt sint et id veniam et fugiat voluptate deserunt dolor qui qui eiusmod veniam. Ipsum exercitation officia est proident enim enim reprehenderit exercitation et quis duis fugiat dolor eiusmod velit labore voluptate cillum.
Nulla duis adipisicing veniam sint dolor eu exercitation</p>
<p>Dolor sit consequat ut anim ea in mollit. Deserunt adipisicing est in occaecat veniam fugiat veniam aute fugiat quis minim laborum aliqua officia ea eu eiusmod qui pariatur. Ullamco commodo amet commodo ullamco et nisi irure labore anim sit dolor id reprehenderit ad culpa veniam est quis.
Ea sit nostrud do laborum consectetur occaecat non consectetur do ullamco minim nostrud labore ex proident officia consequat consectetur. Ad est aliquip aute fugiat duis esse do. Labore incididunt dolore in et dolor. Fugiat adipisicing amet adipisicing culpa commodo aliquip occaecat tempor do consequat eu reprehenderit. Nisi et consequat amet commodo officia laborum et qui quis in elit tempor est elit commodo laboris deserunt incididunt. Do qui duis quis ullamco culpa sit excepteur amet id adipisicing. Elit aute aliquip dolor nulla est pariatur sit ex do reprehenderit mollit Lorem laboris minim adipisicing quis reprehenderit. Commodo occaecat elit anim non ex nisi cupidatat fugiat.
In irure velit laboris.</p>
<p>Consequat non labore nisi do commodo proident fugiat est duis adipisicing deserunt. Nisi cupidatat fugiat voluptate minim proident labore esse est mollit eu sit sint. Ea Lorem nisi duis ex minim non nulla sit dolor eiusmod non cillum officia do nostrud laborum consectetur est laborum. Amet veniam minim elit minim dolore voluptate quis labore dolore nostrud amet laboris et. Est veniam incididunt laborum elit culpa Lorem. Dolor nostrud reprehenderit minim proident. Laborum sit exercitation pariatur ullamco eu ullamco aliquip velit. Cillum nulla laboris ex velit consectetur veniam.</p>
<h2>Remember to use less CH units for headings and large type</h2>
<p>Lorem ipsum dolor sit amet, sint ad proident aliqua. Sunt pariatur eu Lorem esse irure nulla anim laborum esse esse non do laborum duis culpa incididunt. Qui in qui ad quis commodo elit ut culpa mollit exercitation veniam reprehenderit ullamco deserunt incididunt in aute enim ad.
Qui cupidatat sunt adipisicing. Sint est sint dolore laboris deserunt ullamco cillum. Esse tempor anim ipsum laborum Lorem nostrud ut. Velit laboris ad ad in nostrud veniam mollit ullamco labore. Pariatur ad excepteur consequat duis sint amet anim excepteur culpa. Deserunt non consectetur consectetur amet ullamco non ex enim esse et.
Reprehenderit ea elit esse qui velit in et quis veniam. Non id excepteur voluptate do anim commodo occaecat duis. Sunt occaecat laboris magna. Nulla consequat sunt deserunt exercitation exercitation sint sit est aute aliqua mollit laboris exercitation amet culpa mollit elit mollit est. Magna est consectetur irure ipsum nulla aliqua commodo pariatur laboris ipsum ad ad ullamco excepteur ad sint.
Anim in est exercitation culpa officia pariatur.</p>
<p>Lorem ipsum dolor sit amet, sint ad proident aliqua. Sunt pariatur eu Lorem esse irure nulla anim laborum esse esse non do laborum duis culpa incididunt. Qui in qui ad quis commodo elit ut culpa mollit exercitation veniam reprehenderit ullamco deserunt incididunt in aute enim ad.
Qui cupidatat sunt adipisicing.</p>
</article>
h1,
h2 {
max-width: 28ch;
}
p {
max-width: 70ch;
}
sub,
sup {
display: inline-block;
line-height: 1;
}
sup {
transform: translateY(-0.25ex);
}
sub {
transform: translateY(0.25ex);
}
body {
font-family: "Hind";
max-width: 70rem;
margin: 0 auto;
padding: 2rem;
line-height: 1.7;
}
h1,
h2 {
font-family: "Halant";
font-weight: 600;
line-height: 1.3;
}
h1 {
font-size: 3rem;
}
h2 {
font-size: 2.5rem;
}
article > * + * {
margin-top: 1.5em;
}
Also see: Tab Triggers