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" width="800" viewBox="0 0 300 300">
<defs>
<linearGradient id="path1-a" x1="50%" x2="50%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#F5515F" />
<stop offset="100%" stop-color="#9F041B" />
</linearGradient>
</defs>
<path fill="url(#path1-a)" fill-rule="evenodd">
<animate attributeName="d" dur="3s" repeatCount="indefinite" fill="freeze"
values="M202.5,5.5 C272.242316,19.3208858 151.76021,14.551942 176.5,50 C201.23979,85.448058 185.029863,56.2999188 156.5,83.5 C126.029863,112.549919 182.620539,155.708198 120,166 C74.6205388,173.458198 117.31825,121.960229 90,110 C67.0682497,99.9602287 39.9536115,107.435387 35,80 C26.9536115,35.4353868 -5.51923978,70.9721609 2,33 C4.48076022,20.4721609 25.6847866,15.0542119 39.5,21 C65.1847866,32.0542119 67.5960408,62.5320136 81,67 C94.4039592,71.4679864 117.396285,57.4613025 115.5,45 C113.603715,32.5386975 64.8930314,35.3322785 74,21 C83.1069686,6.66772153 132.757684,-8.32088583 202.5,5.5 Z;
M152,17.5 C221.742316,31.3208858 234.26021,-22.948058 259,12.5 C283.73979,47.948058 262.529863,40.2999188 234,67.5 C203.529863,96.5499188 264.120539,144.708198 201.5,155 C156.120539,162.458198 195.31825,119.460229 168,107.5 C145.06825,97.4602287 65.9536115,128.435387 61,101 C52.9536115,56.4353868 30,118 6,122 C8.48076022,109.472161 -6.5,29 6,8.5 C31.6847866,19.5542119 75,80 99.5,67.5 C124,55 159.396285,57.9613025 157.5,45.5 C155.603715,33.0386975 78.8930314,43.3322785 88,29 C97.1069686,14.6677215 82.2576838,3.67911417 152,17.5 Z;
M189.5,16 C259.242316,29.8208858 231.26021,-21.948058 256,13.5 C280.73979,48.948058 197.029863,43.2999188 168.5,70.5 C138.029863,99.5499188 275.120539,136.208198 212.5,146.5 C167.120539,153.958198 146.31825,113.960229 119,102 C96.0682497,91.9602287 74.9536115,156.935387 70,129.5 C61.9536115,84.9353868 61,58 37,62 C39.4807602,49.4721609 -9.5,30 3,9.5 C28.6847866,20.5542119 104,84.5 128.5,72 C153,59.5 166.896285,52.4613025 165,40 C163.103715,27.5386975 64.3930314,25.8322785 73.5,11.5 C82.6069686,-2.83227847 119.757684,2.17911417 189.5,16 Z;
M218.5,8.5 C288.242316,22.3208858 266,63 249,60 C232,57 228.529863,55.7999188 200,83 C169.529863,112.049919 235.620539,105.708198 173,116 C127.620539,123.458198 136.81825,131.460229 109.5,119.5 C86.5682497,109.460229 77.9536115,165.935387 73,138.5 C64.9536115,93.9353868 -11.5,114.5 6,79.5 C8.48076022,66.9721609 -6.5,39 6,18.5 C31.6847866,29.5542119 26.5,27 51,14.5 C75.5,2 100.396285,20.9613025 98.5,8.5 C96.6037148,-3.96130245 126.5,-1.5 151.5,8.5 C176.5,18.5 148.757684,-5.32088583 218.5,8.5 Z
" />
</path>
</svg>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
width: 100vw;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: "Exo", Arial, sans-serif;
font-size: 20px;
font-weight: 600;
background: linear-gradient(to bottom, #0b0a27, #31304c 50%);
}
svg {
height: 100vh;
width: auto;
}
Also see: Tab Triggers