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.
<ol>
<li>
<a href="/blog/2022/100daysof-day70/">
Day 70: the defined pseudo-class
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day69/">
Day 69: width in container queries
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day68/">
Day 68: cascade layers and browser support
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day67/">
Day 67: counting children
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day66/">
Day 66: individual transform properties
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day65/">
Day 65: using the em unit in container queries
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day64/">
Day 64: the revert-layer keyword
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day63/">
Day 63: explicit defaulting with inherit, initial, unset, and revert
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day62/">
Day 62: the container shorthand
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day61/">
Day 61: color-scheme
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day60/">
Day 60: the ::part() pseudo-element
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day59/">
Day 59: naming containers
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day58/">
Day 58: ordering nested layers
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day57/">
Day 57: media queries: range syntax
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day56/">
Day 56: container queries
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day55/">
Day 55: anonymous layers
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day54/">
Day 54: testing for the support of a selector
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day53/">
Day 53: disabling pull-to-refresh
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day52/">
Day 52: declaring multiple layer lists
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day51/">
Day 51: aspect-ratio and replaced elements
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day50/">
Day 50: :has(:not()) vs. :not(:has())
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day49/">
Day 49: layering entire style sheets
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day48/">
Day 48: inset 0
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day47/">
Day 47: the overscroll-behavior property
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day46/">
Day 46: ordering layers
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day45/">
Day 45: the specificity of ::slotted() content
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day44/">
Day 44: logical floating and clearing
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day43/">
Day 43: grouping layers
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day42/">
Day 42: aspect-ratio
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day41/">
Day 41: custom properties and url()s
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day40/">
Day 40: unlayered styles
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day39/">
Day 39: comma-separated functional color notations
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day38/">
Day 38: vh, svh, lvh, and dvh
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day37/">
Day 37: cascade layers
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day36/">
Day 36: :has() and pseudo-elements
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day35/">
Day 35: forgiving selectors
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day34/">
Day 34: :is() or :where()
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day33/">
Day 33: Mathematical expressions in min(), max(), clamp()
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day32/">
Day 32: the clamp() function
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day31/">
Day 31: logical border properties
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day30/">
Day 30: the hwb() color function
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day29/">
Day 29: !important custom properties
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day28/">
Day 28: custom properties and web components
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day27/">
Day 27: the font-variation-settings property
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day26/">
Day 26: using combinators in :has()
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day25/">
Day 25: scrollbar gutters in body and html
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day24/">
Day 24: the backdrop-filter property
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day23/">
Day 23: the lab() color function
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day22/">
Day 22: the ::backdrop pseudo-element
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day21/">
Day 21: conic gradients
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day20/">
Day 20: the scrollbar-gutter property
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day19/">
Day 19: the placeholder-shown pseudo-class
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day18/">
Day 18: inheritable styles and web components
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day17/">
Day 17: the :picture-in-picture pseudo-class
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day16/">
Day 16: the specificity of :has()
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day15/">
Day 15: the :modal pseudo-class
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day14/">
Day 14: the difference between :is() and :where()
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day13/">
Day 13: the :where() and :is() pseudo-classes
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day12/">
Day 12: max() trickery
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day11/">
Day 11: space-separated functional color notations
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day10/">
Day 10: global styles and web components
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day9/">
Day 9: the inset shorthand property
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day8/">
Day 8: nesting :has()
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day7/">
Day 7: subgrids
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day6/">
Day 6: the :has() pseudo-class
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day5/">
Day 5: the max() function
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day4/">
Day 4: the min() function
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day3/">
Day 3: logical property shorthands
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day2/">
Day 2: logical properties
</a>
</li>
<li>
<a href="/blog/2022/100daysof-day1/">
Day 1: custom properties and fallbacks
</a>
</li>
</ol>
ol {
display: grid;
gap: 1rem;
grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
grid-template-rows: masonry;
/*
grid-template-columns: masonry;
grid-template-rows: repeat(auto-fill, 6rem);
*/
}
body, html, ol {
height: 100%;
}
ol {
font-family: sans-serif;
list-style: none;
margin: 0;
padding: 0;
font-size: 2.6rem;
font-weight: bold;
line-height: 1.25;
}
li {
border: 4px solid;
}
a {
display: block;
padding: 1rem;
}
a:is(:link, :visited) {
color: initial;
text-decoration: none;
}
a:is(:hover, :focus-visible) {
background-color: rgb(0 0 0);
color: rgb(255 255 255);
}
Also see: Tab Triggers