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.
<nav>
<ul>
<li><a href="#chapter-1">Chicharrones craft beer</a></li>
<li><a href="#chapter-2">Party tilde</a></li>
<li><a href="#chapter-3">Flexitarian flannel forage</a></li>
<li><a href="#chapter-4">Brunch ennui helvetica</a></li>
</ul>
</nav>
<div class="book">
<section class="chapter" id="chapter-1">
<h1>Chicharrones craft beer</h1>
<p>Kickstarter sustainable helvetica, intelligentsia food truck viral lo-fi lumbersexual stumptown art party. Cold-pressed pinterest distillery kinfolk, plaid direct trade man bun health goth freegan selvage jean shorts bespoke.</p>
<section class="subchapter">
<h2>Tumblr stumptown</h2>
<p>Paleo disrupt fixie schlitz, leggings jean shorts polaroid XOXO ennui meggings church-key chillwave cardigan readymade master cleanse. Deep v sustainable whatever keffiyeh +1. Shoreditch tacos food truck vegan viral, umami thundercats mixtape truffaut bitters cred man braid cray twee humblebrag. </p>
</section>
<section class="subchapter">
<h2>Put a bird on it</h2>
<p>Farm-to-table heirloom migas asymmetrical hashtag, celiac chambray trust fund tote bag. Single-origin coffee celiac lumbersexual squid tousled, man bun blog iPhone. Humblebrag photo booth meditation vice pork belly, paleo retro biodiesel yuccie heirloom echo park mixtape. Distillery cornhole migas ethical, cred viral hammock.</p>
</section>
<section class="subchapter">
<h2>Kickstarter roof</h2>
<p>Tofu chambray knausgaard 90's freegan gastropub lo-fi kitsch. PBR&B next level pork belly, stumptown affogato seitan thundercats neutra tote bag literally. Keffiyeh mlkshk asymmetrical leggings, offal kickstarter tacos.</p>
</section>
</section>
<section class="chapter" id="chapter-2">
<h1>Party tilde</h1>
<p>Etsy vice shoreditch synth, aesthetic food truck kinfolk chicharrones gochujang pug swag. Brooklyn paleo typewriter, photo booth gluten-free yr shabby chic vegan selfies distillery irony echo park kitsch chambray. Selfies pork belly art party, before they sold out gluten-free seitan thundercats direct trade gochujang wayfarers.</p>
<section class="subchapter">
<h2>Meditation 90's austin DIY</h2>
<p>Portland kogi tousled, retro hashtag meh asymmetrical irony letterpress. Church-key tacos 8-bit lumbersexual, mixtape fap actually whatever authentic jean shorts synth. Skateboard vice forage artisan plaid ennui, swag bespoke fap. Bitters ugh austin, sartorial raw denim shabby chic craft beer helvetica keffiyeh crucifix.</p>
</section>
<section class="subchapter">
<h2>Sriracha occupy umami</h2>
<p>Occupy tousled pinterest flexitarian, distillery banjo green juice 8-bit pop-up church-key ethical jean shorts PBR&B irony. Shabby chic tote bag wolf art party, celiac craft beer pug keytar godard mumblecore austin viral affogato bicycle rights taxidermy. +1 kinfolk yr tumblr poutine raw denim street art, drinking vinegar jean shorts church-key narwhal.</p>
</section>
<section class="subchapter">
<h2>Portland gastropub</h2>
<p>Four dollar toast neutra before they sold out, umami chambray listicle fixie. Migas banjo kogi retro. Asymmetrical mumblecore portland, squid migas craft beer jean shorts yr four dollar toast hoodie scenester williamsburg mixtape forage. Hammock twee deep v small batch tofu slow-carb.</p>
</section>
</section>
<section class="chapter" id="chapter-3">
<h1>Flexitarian flannel forage</h1>
<p>Small batch portland tattooed shoreditch austin 8-bit. Biodiesel artisan fingerstache street art, four loko synth mixtape cray kinfolk umami. Selvage keytar raw denim shoreditch heirloom, deep v banjo forage. Actually umami lumbersexual, skateboard banjo kickstarter sustainable small batch chillwave wolf cliche whatever.</p>
<section class="subchapter">
<h2>Pinterest microdosing</h2>
<p>Everyday carry gentrify pop-up roof party, pork belly salvia umami cardigan distillery pickled four loko waistcoat iPhone. Twee organic you probably haven't heard of them, flexitarian franzen 8-bit cornhole cold-pressed. Cornhole selfies butcher viral, man bun austin chillwave leggings.</p>
</section>
<section class="subchapter">
<h2>Fanny pack lo-fi godard</h2>
<p>Pabst raw denim everyday carry photo booth intelligentsia viral portland tacos occupy, tofu bespoke. Pabst freegan vinyl, pop-up literally readymade XOXO dreamcatcher lumbersexual. Seitan gastropub kombucha, vice umami photo booth forage craft beer cray narwhal squid DIY 3 wolf moon try-hard.</p>
</section>
</section>
<section class="chapter" id="chapter-4">
<h1>Brunch ennui helvetica</h1>
<p>Jean shorts semiotics yr chillwave seitan, pug everyday carry organic. Pop-up 90's migas biodiesel, semiotics banh mi 8-bit direct trade. Four loko chartreuse ramps tote bag, everyday carry cray chia bushwick. VHS gentrify cray pork belly, banh mi tote bag bitters cronut selfies. Stumptown small batch trust fund fingerstache gluten-free man braid. Cardigan slow-carb venmo forage, pork belly migas poutine offal.</p>
<section class="subchapter">
<h2>Slow-carb vegan</h2>
<p>Food truck normcore sartorial, XOXO single-origin coffee franzen brooklyn ennui man bun mustache letterpress. Bushwick wayfarers selfies lomo, bespoke listicle typewriter before they sold out kale chips marfa. Banh mi shoreditch cliche, pug franzen ethical raw denim humblebrag artisan. Small batch iPhone hoodie, bicycle rights viral humblebrag franzen tumblr brooklyn brunch whatever selvage.</p>
</section>
<section class="subchapter">
<h2>Stumptown salvia</h2>
<p>Twee taxidermy hoodie semiotics VHS, knausgaard health goth green juice +1 tofu waistcoat flexitarian. Slow-carb post-ironic semiotics paleo. Drinking vinegar kitsch gastropub, leggings bespoke semiotics wolf salvia. Chambray health goth organic fingerstache, seitan chicharrones flexitarian twee jean shorts hella yr +1 cray tote bag crucifix.</p>
</section>
<section class="subchapter">
<h2>Offal yuccie</h2>
<p>Cred irony you probably haven't heard of them, sustainable microdosing migas PBR&B austin. Trust fund biodiesel kombucha, salvia franzen umami pop-up polaroid kitsch craft beer typewriter selfies chambray organic. Forage mlkshk keffiyeh cornhole asymmetrical. Cray blue bottle locavore vegan typewriter kombucha. Skateboard truffaut try-hard, chicharrones sustainable dreamcatcher fixie tousled scenester swag.</p>
</section>
</section>
</div>
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700);
.book {
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 1rem;
line-height: 1.5;
width: 75ch;
margin: 0 auto;
}
nav ul {
list-style-type: none;
padding: 1rem 0;
margin: 0;
border-bottom: 4px solid black;
position: -webkit-sticky;
position: sticky;
top: 0;
left: 0;
right: 0;
text-align: center;
background-color: gold;
}
nav ul li {
display: inline-block;
margin: 0 1rem;
font-weight: 700;
}
nav a {
color: black;
text-decoration: none;
}
nav a:hover {
text-decoration: underline;
}
Also see: Tab Triggers