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.
<svg xmlns="http://www.w3.org/2000/svg" height="200" width="200">
<mask id="mask1" maskUnits="userSpaceOnUse">
<path d="M 31.9487,100.851 C 96.8992,64.2568 175.699,103.585 161.504,136.176" />
</mask>
<mask id="mask2" maskUnits="userSpaceOnUse">
<path d="M 161.504,136.1 C 151.163,159.889 120.894,170.131 88.2534,145.001 62.0856,118.537 58.512,76.2969 69.8584,29.8113" />
</mask>
<path mask="url(#mask1)" d="M 168.206,138.99 C 170.791,131.695 172.093,126.393 172.093,123.083 172.093,118.157 170.167,113.218 166.296,108.295 162.427,103.37 156.861,99.2861 149.894,95.4321 122.211,80.0994 97.5906,75.2909 64.5063,79.4735 47.3629,81.6329 39.9523,86.638 34.9294,88.4823 32.3111,89.4367 34.386,97.3431 38.2888,109.578 47.05,105.626 56.6345,100.735 66.5649,98.3311 78.4879,95.4321 89.9662,93.0111 93.6059,93.0111 102.499,93.0111 111.292,94.8891 119.971,98.6441 128.666,102.514 136.175,107.7 142.5,114.239 148.938,120.777 153.434,126.458 155.46,133.539 Z" />
<path mask="url(#mask2)" d="M 155.46,133.539 C 152.891,136.537 148.873,140.079 143.949,141.905 139.008,143.832 134.183,144.804 129.473,144.804 116.612,144.804 105.726,140.457 96.8168,131.778 88.023,123.198 80.6617,111.505 76.8739,86.8862 73.6627,66.0205 77.7468,43.228 81.3864,34.3174 L 58.9894,30.707 C 52.4351,48.8322 50.5413,66.6778 51.974,91.1671 53.8844,124.12 64.2759,142.218 77.0386,154.126 89.8015,166.131 106.204,172.141 126.245,172.141 132.471,172.141 138.794,170.905 145.233,168.435 151.672,166.081 156.217,163.248 158.902,159.922 160.614,157.88 164.667,149.315 168.206,138.99 161.003,134.478 158.62,134.617 155.46,133.539 Z" />
</svg>
mask path {
fill: none;
stroke: white;
stroke-width: 32;
}
#mask1 path {
stroke-dasharray: 160 160;
stroke-dashoffset: 160;
animation: brush1 5s linear infinite;
}
@keyframes brush1 {
0% { stroke-dashoffset: 160; }
12% { stroke-dashoffset: 160; }
44% { stroke-dashoffset: 0; }
100% { stroke-dashoffset: 0; }
}
#mask2 path {
stroke-dasharray: 210 210;
stroke-dashoffset: 210;
animation: brush2 5s linear infinite;
}
@keyframes brush2 {
0% { stroke-dashoffset: 210; }
44% { stroke-dashoffset: 210; }
86% { stroke-dashoffset: 0; }
100% { stroke-dashoffset: 0; }
}
Also see: Tab Triggers