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 width="300" height="300" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M199.33 125.51C201.54 124.72 203.89 124.22 206.37 124.22V124.2C218 124.2 227.46 133.66 227.46 145.29V181.72C227.46 225.15 192.16 260.88 148.74 260.12C106.74 259.39 72.7903 224.99 72.7803 182.81L72.5303 99.6299C72.5303 87.9899 81.9903 78.5199 93.6203 78.5199C96.1203 78.5199 98.4803 79.0299 100.7 79.8299C100.74 79.8499 100.77 79.8199 100.77 79.7899C101.38 68.7099 110.51 59.8499 121.75 59.8499C124.23 59.8499 126.57 60.3599 128.78 61.1499V60.9299C128.78 47.4599 141.49 36.8799 155.55 40.5799C164.72 42.9899 170.97 51.4899 170.97 60.9699V61.0799C170.97 61.1199 171.01 61.1399 171.04 61.1299C173.23 60.3599 175.55 59.8599 178 59.8599C189.63 59.8599 199.09 69.3199 199.09 80.9499L199.26 125.46C199.26 125.5 199.3 125.52 199.33 125.51ZM86.8403 182.82C86.8403 218.01 115.73 246.6 151.05 246.09L151.06 246.07C185.81 245.57 213.41 216.55 213.41 181.79V164.01C213.41 163.97 213.37 163.95 213.34 163.96C211.16 164.78 208.78 165.25 206.34 165.25C203.9 165.25 201.57 164.79 199.41 163.99C199.37 163.98 199.34 164.04 199.34 164.04V179.72H185.33C185.3 179.72 185.28 179.67 185.28 179.67V145.34L185.1 99.6799C185.1 99.6399 185.06 99.6199 185.03 99.6299C182.84 100.46 180.46 100.93 178 100.93C175.54 100.93 173.2 100.46 171.03 99.6499C170.99 99.6399 170.96 99.6999 170.96 99.6999V147.16C170.96 147.19 170.91 147.21 170.91 147.21H156.95C156.92 147.21 156.9 147.16 156.9 147.16V79.6299C154.71 80.4599 152.34 80.9299 149.87 80.9299C147.4 80.9299 145.03 80.4599 142.84 79.6299V147.18C142.84 147.21 142.79 147.23 142.79 147.23H128.83C128.8 147.23 128.78 147.18 128.78 147.18V99.6999C128.78 99.6599 128.74 99.6399 128.71 99.6499C126.53 100.47 124.14 100.94 121.71 100.94C119.28 100.94 116.95 100.48 114.79 99.6799C114.75 99.6699 114.72 99.7299 114.72 99.7299V147.18C114.72 147.21 114.67 147.23 114.67 147.23H100.71C100.68 147.23 100.66 147.18 100.66 147.18V118.43C100.66 118.39 100.62 118.37 100.59 118.38C98.4203 119.19 96.0603 119.65 93.6303 119.65C91.2003 119.65 88.8803 119.19 86.7203 118.39C86.6803 118.38 86.6503 118.44 86.6503 118.44L86.8403 182.82ZM159.616 215V209.846H145.608V182.932H139V215H143.471H145.608H159.616Z" fill="#4D555C"/>
<path d="M93.6299 88.6396C99.7099 88.6396 104.63 93.5596 104.63 99.6396C104.63 105.72 99.7099 110.64 93.6299 110.64C87.5499 110.64 82.6299 105.72 82.6299 99.6396C82.6299 93.5596 87.5499 88.6396 93.6299 88.6396Z" fill="#272C33"/>
<path d="M121.71 69.9297C127.79 69.9297 132.71 74.8497 132.71 80.9297C132.71 87.0097 127.79 91.9297 121.71 91.9297C115.63 91.9297 110.71 87.0097 110.71 80.9297C110.71 74.8497 115.63 69.9297 121.71 69.9297Z" fill="#272C33"/>
<path d="M149.88 49.9297C155.96 49.9297 160.88 54.8497 160.88 60.9297C160.88 67.0097 155.96 71.9297 149.88 71.9297C143.8 71.9297 138.88 67.0097 138.88 60.9297C138.88 54.8497 143.8 49.9297 149.88 49.9297Z" fill="#272C33"/>
<path class="index" d="M178 69.9297C184.08 69.9297 189 74.8497 189 80.9297C189 87.0097 184.08 91.9297 178 91.9297C171.92 91.9297 167 87.0097 167 80.9297C167 74.8497 171.92 69.9297 178 69.9297Z" fill="#272C33"/>
<path class="thumb" d="M206.34 134.26C212.42 134.26 217.34 139.18 217.34 145.26C217.34 151.34 212.42 156.26 206.34 156.26C200.26 156.26 195.34 151.33 195.34 145.26C195.34 139.19 200.26 134.26 206.34 134.26Z" fill="#272C33"/>
</svg>
.thumb{
fill:red;
}
.index{
fill:green;
}
Also see: Tab Triggers