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="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M31 52C31 41.5066 39.5066 33 50 33V33C60.4934 33 69 41.5066 69 52V81H31V52Z" fill="rgba(255,0,0,1)" stroke="rgba(0,0,0,1)" stroke-width="4.0px"></path><path d="M28.5656 78.4118C28.8238 77.5726 29.5991 77 30.4771 77H69.5228C70.4009 77 71.1762 77.5726 71.4344 78.4118L74.2036 87.4118C74.5994 88.6979 73.6377 90 72.2921 90H27.7079C26.3623 90 25.4006 88.6979 25.7964 87.4118L28.5656 78.4118Z" fill="rgba(255,0,0,1)" stroke="rgba(0,0,0,1)" stroke-width="4.0px"></path><path class="line-warning7-a" d="M50 27.5V15" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path><path class="line-warning7-f" d="M12.75 54.25L25.25 54.25" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path><path class="line-warning7-e" d="M74.75 54.25L87.25 54.25" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path><path class="line-warning7-h" d="M22.3673 26.6175L31.2062 35.4563" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path><path class="line-warning7-c" d="M77.6324 26.6175L68.7936 35.4563" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path><path class="line-warning7-b" d="M60 30L64 23" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path><path class="line-warning7-i" d="M40 30L36 23" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path><path class="line-warning7-g" d="M25.5 45L19 42" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path><path class="line-warning7-d" d="M75 45L81.5 42" stroke="rgba(0,0,0,1)" stroke-width="4.0px" style="animation-duration: 2s;"></path></svg>
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g class="line-gesture1" style="animation-duration: 1.5s;"><path d="M71.5 94H36C36 94 35 88 31.5 84.5C27.7417 80.7417 26 75 26 75V58C26 55.7909 27.7909 54 30 54H38.5V28C38.5 28 39 22 44 22C49 22 49.5 28 49.5 28V45.5C49.5 45.5 74.5 48 77 53C79.5 58 71.5 94 71.5 94Z" fill="rgba(255,219,153,1)" stroke-width="1.7px"></path><path d="M38.5 54V28C38.5 28 39 22 44 22C49 22 49.5 28 49.5 28V45.5C49.5 45.5 74.5 48 77 53C79.5 58 71.5 94 71.5 94H36C36 94 35 88 31.5 84.5C27.7417 80.7417 26 75 26 75V58C26 55.7909 27.7909 54 30 54H38.5ZM38.5 54V66.5" stroke="rgba(0,0,0,1)" stroke-width="1.7px"></path></g><line class="line-gesture1-c" x1="43" y1="16" x2="43" y2="6" stroke="rgba(0,0,0,1)" stroke-width="1.7px" style="animation-duration: 1.5s;"></line><line class="line-gesture1-e" x1="56" y1="27" x2="66" y2="27" stroke="rgba(0,0,0,1)" stroke-width="1.7px" style="animation-duration: 1.5s;"></line><line class="line-gesture1-a" x1="32" y1="27" x2="22" y2="27" stroke="rgba(0,0,0,1)" stroke-width="1.7px" style="animation-duration: 1.5s;"></line><line class="line-gesture1-d" x1="51" y1="19" x2="58" y2="12" stroke="rgba(0,0,0,1)" stroke-width="1.7px" style="animation-duration: 1.5s;"></line><line class="line-gesture1-b" x1="35" y1="19" x2="28" y2="12" stroke="rgba(0,0,0,1)" stroke-width="1.7px" style="animation-duration: 1.5s;"></line></svg>
.line-warning7-a {animation:line-warning7-a 2s infinite;}
.line-warning7-b {animation:line-warning7-b 2s infinite;}
.line-warning7-c {animation:line-warning7-c 2s infinite;}
.line-warning7-d {animation:line-warning7-d 2s infinite;}
.line-warning7-e {animation:line-warning7-e 2s infinite;}
.line-warning7-f {animation:line-warning7-f 2s infinite;}
.line-warning7-g {animation:line-warning7-g 2s infinite;}
.line-warning7-h {animation:line-warning7-h 2s infinite;}
.line-warning7-i {animation:line-warning7-i 2s infinite;}
@keyframes line-warning7-a {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(0, -4px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(0, -4px, 0); opacity: 0;}
}
@keyframes line-warning7-b {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(2px, -4px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(2px, -4px, 0); opacity: 0;}
}
@keyframes line-warning7-c {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(4px, -2px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(4px, -2px, 0); opacity: 0;}
}
@keyframes line-warning7-d {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(4px, -2px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(4px, -2px, 0); opacity: 0;}
}
@keyframes line-warning7-e {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(4px, 0, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(4px, 0, 0); opacity: 0;}
}
@keyframes line-warning7-f {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(-4px, 0, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(-4px, 0, 0); opacity: 0;}
}
@keyframes line-warning7-g {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(-4px, -2px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(-4px, -2px, 0); opacity: 0;}
}
@keyframes line-warning7-h {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(-4px, -2px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(-4px, -2px, 0); opacity: 0;}
}
@keyframes line-warning7-i {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(-2px, -4px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(-2px, -4px, 0); opacity: 0;}
}
.line-gesture1 {animation:tap 1.4s infinite; transform-origin: 54px 100px;}
@keyframes tap {
0%{transform:rotateX(0);}
20%{transform:rotateX(-40deg);}
40%{transform:rotateX(10deg);}
100%{transform:rotateX(0);}
}
.line-gesture1-a {animation:line-gesture1-a 1.4s infinite;}
.line-gesture1-b {animation:line-gesture1-b 1.4s infinite;}
.line-gesture1-c {animation:line-gesture1-c 1.4s infinite;}
.line-gesture1-d {animation:line-gesture1-d 1.4s infinite;}
.line-gesture1-e {animation:line-gesture1-e 1.4s infinite;}
@keyframes line-gesture1-a {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(-4px, 0, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(-4px, 0, 0); opacity: 0;}
}
@keyframes line-gesture1-b {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(-4px, -4px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(-4px, -4px, 0); opacity: 0;}
}
@keyframes line-gesture1-c {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(0, -4px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(0, -4px, 0); opacity: 0;}
}
@keyframes line-gesture1-d {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(4px, -4px, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(4px, -4px, 0); opacity: 0;}
}
@keyframes line-gesture1-e {
0%{opacity: 0;}
20%{transform:translate3d(0, 0, 0); opacity: 0;}
60%{opacity: .8;}
70%{transform:translate3d(4px, 0, 0); opacity: .8;}
90%{opacity: 0;}
100%{transform:translate3d(4px, 0, 0); opacity: 0;}
}
Also see: Tab Triggers