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.
<!--
Tufte CSS style footnotes, minimum viable markup:
<input id="fn1" type="checkbox">
<label for="fn1">1</label>
<small>Footnote text</small>
This is just a test, so unlike the original, they're not really accessible. #3 would be best for touchscreens, as clicking anywhere else closes the popup note.
-->
<p class="inline">(…) The lack of a clear definition of the word allowed it to be appropriated as a placeholder word in computer programming,<input id="i1" type="checkbox"><label for="i1">1</label><small>
Bautts, T., Dawson, T. & Purdy G. (2005) <em>Linux Network Administrator's Guide</em>. O'Reilly, p. 64. ISBN 9780596005481
</small> particularly by those with ties to <em>Discordianism</em> or the <em>Church of the SubGenius</em>.<input id="i2" type="checkbox"><label for="i2">2</label><small>
Raymond, Eric S. (1996) <em>The New Hacker's Dictionary</em>. MIT Press, p. 196. ISBN 9780262680929
</small> It has also been found useful as the name for a “techno cultural” conference,<input id="i3" type="checkbox"><label for="i3">3</label><small>
FNORD 2014, Northern India Engineering College, Delhi, Techno Cultural Festival, Delhi, March 5-7 2014
</small> computer programs,<input id="i4" type="checkbox"><label for="i4">4</label><small>
Richard Raucci (1 January 1997). <em>A Windows NTTM Guide to the Web: Covering Browsers, Servers, and Related Software</em>. Taylor & Francis. p. 50. ISBN 978-0-387-94792-1
</small> and as a general placeholder word in computing literature.<input id="i5" type="checkbox"><label for="i5">5</label><small>
Claudia Linnhoff-Popien; Heinz-Gerd Hegering (1 September 2000). <em>Trends in Distributed Systems: Towards a Universal Service Market: Third International IFIP/GI Working Conference, USM 2000 Munich, Germany, September 12-14, 2000 Proceedings</em>. Springer. p. 62. ISBN 978-3-540-41024-9
</small></p>
<p class="block">(…) The lack of a clear definition of the word allowed it to be appropriated as a placeholder word in computer programming,<input id="b1" type="checkbox"><label for="b1">1</label><small>
Bautts, T., Dawson, T. & Purdy G. (2005) <em>Linux Network Administrator's Guide</em>. O'Reilly, p. 64. ISBN 9780596005481
</small> particularly by those with ties to <em>Discordianism</em> or the <em>Church of the SubGenius</em>.<input id="b2" type="checkbox"><label for="b2">2</label><small>
Raymond, Eric S. (1996) <em>The New Hacker's Dictionary</em>. MIT Press, p. 196. ISBN 9780262680929
</small> It has also been found useful as the name for a “techno cultural” conference,<input id="b3" type="checkbox"><label for="b3">3</label><small>
FNORD 2014, Northern India Engineering College, Delhi, Techno Cultural Festival, Delhi, March 5-7 2014
</small> computer programs,<input id="b4" type="checkbox"><label for="b4">4</label><small>
Richard Raucci (1 January 1997). <em>A Windows NTTM Guide to the Web: Covering Browsers, Servers, and Related Software</em>. Taylor & Francis. p. 50. ISBN 978-0-387-94792-1
</small> and as a general placeholder word in computing literature.<input id="b5" type="checkbox"><label for="b5">5</label><small>
Claudia Linnhoff-Popien; Heinz-Gerd Hegering (1 September 2000). <em>Trends in Distributed Systems: Towards a Universal Service Market: Third International IFIP/GI Working Conference, USM 2000 Munich, Germany, September 12-14, 2000 Proceedings</em>. Springer. p. 62. ISBN 978-3-540-41024-9
</small></p>
<p class="hover">(…) The lack of a clear definition of the word allowed it to be appropriated as a placeholder word in computer programming,<input id="h1" type="checkbox"><label for="h1">1</label><small>
Bautts, T., Dawson, T. & Purdy G. (2005) <em>Linux Network Administrator's Guide</em>. O'Reilly, p. 64. ISBN 9780596005481
</small> particularly by those with ties to <em>Discordianism</em> or the <em>Church of the SubGenius</em>.<input id="h2" type="checkbox"><label for="h2">2</label><small>
Raymond, Eric S. (1996) <em>The New Hacker's Dictionary</em>. MIT Press, p. 196. ISBN 9780262680929
</small> It has also been found useful as the name for a “techno cultural” conference,<input id="h3" type="checkbox"><label for="h3">3</label><small>
FNORD 2014, Northern India Engineering College, Delhi, Techno Cultural Festival, Delhi, March 5-7 2014
</small> computer programs,<input id="h4" type="checkbox"><label for="h4">4</label><small>
Richard Raucci (1 January 1997). <em>A Windows NTTM Guide to the Web: Covering Browsers, Servers, and Related Software</em>. Taylor & Francis. p. 50. ISBN 978-0-387-94792-1
</small> and as a general placeholder word in computing literature.<input id="h5" type="checkbox"><label for="h5">5</label><small>
Claudia Linnhoff-Popien; Heinz-Gerd Hegering (1 September 2000). <em>Trends in Distributed Systems: Towards a Universal Service Market: Third International IFIP/GI Working Conference, USM 2000 Munich, Germany, September 12-14, 2000 Proceedings</em>. Springer. p. 62. ISBN 978-3-540-41024-9
</small></p>
p input {
display: none;
}
/* Sup text */
p input + label {
font: 0.7em / 1 system-ui, sans-serif;
vertical-align: super;
cursor: pointer;
transition: color 0.1s;
}
p input + label:before {
content: "[";
}
p input + label:after {
content: "]";
}
p input + label:hover {
color: #838374;
}
/* Footnote text */
small {
color: #838374;
font-size: 0.875em;
font-family: IBM Plex Sans, sans-serif;
}
p input + label + small {
transition: opacity 0.2s 0.05s;
position: absolute;
opacity: 0;
visibility: hidden;
}
p input:checked + label + small {
position: relative;
opacity: 1;
visibility: visible;
}
/******* Flavors *******/
/* inline reveal */
p.inline input:checked + label + small {
margin: 0 0.15em;
}
/* block reveal */
p.block input:checked + label + small {
display: block;
color: #838374;
padding: 1ch 3ch;
}
/* hover reveal */
p.hover input + label + small,
p.hover input:checked + label + small {
display: none;
}
p.hover input + label:hover + small {
font-size:.8em;
z-index: 1;
position: absolute;
display: block;
opacity: 1;
visibility: visible;
padding: 0.3em 0.8em 0.4em;
border-bottom: 1px;
right: 4ch;
left: 4ch;
background: #222222ee;
color: #eee;
box-shadow: 0 0 1em rgba(0, 0, 0, 0.2);
border-radius: 3px;
pointer-events: none;
}
/******************
Page demo styles */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font: 19px / 1.5 IBM Plex Serif, serif;
padding: 5em 5vw;
max-width: 70ch;
margin: 0 auto;
}
p {
position: relative;
}
p + p {
margin-top: 4em;
}
p:before {
text-transform: uppercase;
position: absolute;
left: 0;
top: -2.5em;
font-size: 0.7em;
letter-spacing: 1px;
color: #838374;
font-family: IBM Plex Sans, sans-serif;
content: attr(class);
}
Also see: Tab Triggers