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.
<div class="svg-container">
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 446 415">
<style>
.st0{fill:#e5e5e5}.st1{fill:#96a31d}.st2{fill:#bfbfbf}.st3{fill:#bbd032}.st4{fill:#2e2d2c}.st5{fill:#fff}.st6{fill:none;stroke:#2e2d2c;stroke-miterlimit:10}
</style>
<g class="clouds">
<path class="st0 cloud" d="M147.707 92.422c0-9.055 7.369-16.421 16.427-16.421.545 0 1.106.033 1.723.101 3.894-7.247 11.32-11.717 19.567-11.717a22.163 22.163 0 0 1 21.334 16.048c7.686.174 13.886 6.482 13.886 14.208 0 7.836-6.376 14.21-14.213 14.21h-42.299c-9.059 0-16.43-7.369-16.425-16.43zm58.24-9.758c-.493-.007-.976-.336-1.1-.839a19.964 19.964 0 0 0-19.423-15.231c-7.666 0-14.548 4.29-17.954 11.194-.212.428-.68.673-1.152.602a14.471 14.471 0 0 0-2.186-.183c-7.84 0-14.221 6.376-14.221 14.215 0 7.84 6.378 14.22 14.221 14.22h42.3c6.62 0 12.006-5.382 12.006-12.001s-5.386-12.004-12.007-12.004l-.485.027z"/>
<path class="st0 cloud" d="M147.705 92.426c0-9.054 7.368-16.42 16.427-16.42 4.748 0 9.26 2.049 12.379 5.625a1.103 1.103 0 0 1-1.661 1.45 14.228 14.228 0 0 0-10.718-4.872c-7.84 0-14.221 6.376-14.221 14.215 0 7.84 6.378 14.22 14.221 14.22a1.104 1.104 0 0 1 0 2.207c-9.059 0-16.43-7.369-16.427-16.425zM27.36 176.78c0-12.076 9.828-21.902 21.91-21.902.727 0 1.475.045 2.299.136 5.193-9.667 15.098-15.629 26.098-15.629a29.562 29.562 0 0 1 28.456 21.405c10.252.233 18.52 8.646 18.52 18.951 0 10.452-8.504 18.954-18.956 18.954h-56.42c-12.082 0-21.914-9.829-21.908-21.914zm77.68-13.015c-.657-.009-1.301-.447-1.466-1.118a26.628 26.628 0 0 0-25.907-20.316c-10.226 0-19.404 5.723-23.947 14.931-.283.57-.907.897-1.536.803-1.113-.167-2.04-.244-2.917-.244-10.458 0-18.968 8.504-18.968 18.96 0 10.458 8.507 18.968 18.968 18.968h56.42c8.831 0 16.014-7.18 16.014-16.008s-7.183-16.011-16.014-16.011l-.647.035z"/>
<path class="st0 cloud" d="M27.356 176.787c0-12.077 9.829-21.903 21.911-21.903 6.333 0 12.35 2.734 16.512 7.504a1.471 1.471 0 0 1-2.216 1.933 18.977 18.977 0 0 0-14.296-6.497c-10.458 0-18.968 8.504-18.968 18.96 0 10.458 8.507 18.968 18.968 18.968a1.472 1.472 0 0 1 0 2.943c-12.082 0-21.914-9.829-21.91-21.908zM321.36 70.78c0-12.076 9.828-21.902 21.91-21.902.727 0 1.475.045 2.299.136 5.193-9.667 15.098-15.629 26.098-15.629a29.562 29.562 0 0 1 28.456 21.405c10.252.233 18.52 8.646 18.52 18.951 0 10.452-8.504 18.954-18.956 18.954h-56.42c-12.082 0-21.914-9.829-21.908-21.914zm77.68-13.015c-.657-.009-1.301-.447-1.466-1.118a26.628 26.628 0 0 0-25.907-20.316c-10.226 0-19.404 5.723-23.947 14.931-.283.57-.907.897-1.536.803-1.113-.167-2.04-.244-2.917-.244-10.458 0-18.968 8.504-18.968 18.96 0 10.458 8.507 18.968 18.968 18.968h56.42c8.831 0 16.014-7.18 16.014-16.008s-7.183-16.011-16.014-16.011l-.647.035z"/>
<path class="st0 cloud" d="M321.356 70.787c0-12.077 9.829-21.903 21.911-21.903 6.333 0 12.35 2.734 16.512 7.504a1.471 1.471 0 0 1-2.216 1.933 18.977 18.977 0 0 0-14.296-6.497c-10.458 0-18.968 8.504-18.968 18.96 0 10.458 8.507 18.968 18.968 18.968a1.472 1.472 0 0 1 0 2.943c-12.082 0-21.914-9.829-21.91-21.908zM336.357 218.62c0-5.001 4.07-9.07 9.074-9.07.301 0 .61.018.952.056 2.15-4.003 6.252-6.472 10.807-6.472 5.495 0 10.272 3.62 11.784 8.864 4.246.096 7.67 3.58 7.67 7.848 0 4.328-3.522 7.849-7.85 7.849H345.43c-5.004 0-9.075-4.07-9.073-9.075zm32.169-5.39a.633.633 0 0 1-.607-.463 11.027 11.027 0 0 0-10.729-8.413c-4.234 0-8.035 2.37-9.916 6.183a.611.611 0 0 1-.637.333 7.992 7.992 0 0 0-1.207-.101c-4.331 0-7.855 3.521-7.855 7.85 0 4.332 3.523 7.856 7.855 7.856h23.364a6.637 6.637 0 0 0 6.631-6.63 6.638 6.638 0 0 0-6.631-6.63l-.268.015z"/>
<path class="st0 cloud" d="M336.356 218.622c0-5 4.07-9.07 9.074-9.07a9.07 9.07 0 0 1 6.837 3.108.61.61 0 0 1-.917.8 7.859 7.859 0 0 0-5.92-2.69c-4.331 0-7.855 3.522-7.855 7.851 0 4.331 3.523 7.855 7.855 7.855a.61.61 0 0 1 0 1.219c-5.004 0-9.075-4.07-9.074-9.073z"/>
</g> <!-- clouds-->
<g id="rocket">
<path class="st1 wings" d="M285.863 267.695l38 14 19 84-71-64zM187.863 267.695l-38 14-19 84 71-64z"/>
<path class="st0 flame-outer " d="M267.254 328.283c0-16.781-13.606-30.387-30.39-30.387s-30.392 13.606-30.392 30.387c0 16.785 13.61 53.332 30.391 53.332 16.785 0 30.391-36.547 30.391-53.332zm0 0"/>
<path class="st2 flame-inner" d="M251.711 327.424c0-8.2-6.649-14.848-14.848-14.848-8.199 0-14.848 6.648-14.848 14.848 0 8.203 6.65 26.058 14.848 26.058 8.2 0 14.848-17.855 14.848-26.058zm0 0"/>
<path class="st3 rocket-main" d="M270.893 93.77h.002l-.047-.083a208.352 208.352 0 0 0-3.346-5.955l-.257-.436c-.501-.854-1.009-1.704-1.523-2.55-.079-.13-.156-.26-.236-.39a186.199 186.199 0 0 0-3.585-5.64l-.385-.578c-.499-.747-1.002-1.49-1.51-2.228-.13-.186-.257-.373-.386-.559a163.972 163.972 0 0 0-3.802-5.247c-.175-.231-.351-.46-.527-.69-.491-.643-.987-1.281-1.487-1.915-.18-.227-.359-.456-.54-.682a146.01 146.01 0 0 0-1.998-2.45l-.12-.142c-.63-.751-1.267-1.493-1.91-2.228-.212-.244-.427-.485-.642-.727-.499-.562-1.002-1.12-1.508-1.672-.217-.236-.433-.473-.651-.707-.698-.75-1.401-1.493-2.114-2.222l-.145-.144a120.453 120.453 0 0 0-2.036-2.023c-.23-.224-.461-.444-.692-.665-.534-.51-1.072-1.014-1.614-1.513-.231-.212-.462-.426-.694-.636-.752-.68-1.51-1.352-2.276-2.007-.771.658-1.532 1.334-2.288 2.018-.22.199-.438.401-.657.602-.562.516-1.119 1.038-1.671 1.567-.213.204-.427.406-.638.612a123.126 123.126 0 0 0-4.348 4.444c-.19.203-.377.41-.565.614-.542.59-1.08 1.186-1.612 1.788-.188.21-.375.421-.562.634a142.57 142.57 0 0 0-4.08 4.884c-.162.202-.321.405-.481.608a153.16 153.16 0 0 0-1.55 1.995l-.487.637a163.925 163.925 0 0 0-3.815 5.264c-.133.19-.263.383-.395.574-.5.725-.994 1.454-1.484 2.187l-.42.63c-1.21 1.83-2.389 3.686-3.537 5.564l-.337.556c-.467.77-.93 1.544-1.387 2.322l-.375.64a208.294 208.294 0 0 0-3.246 5.774l-.097.176h.003c-18.17 33.639-27.104 71.588-27.104 90.05 0 27.649 8.878 94.649 19.284 134.138h83.696c10.406-39.49 19.285-106.49 19.285-134.137 0-18.463-8.933-56.412-27.103-90.051z"/>
<path class="st4 booster" d="M188.054 286.572c2.176 11.398 4.528 22.145 6.961 31.387h83.696c2.437-9.242 4.79-19.99 6.961-31.387h-97.618zm0 0"/>
<g class="circle-group">
<circle class="st4" cx="236.863" cy="173.695" r="37"/>
<circle class="st5" cx="236.863" cy="173.695" r="31"/>
</g>
</g>
</svg>
</div>
.svg-container {
width: 80%;
max-width: 400px;
margin: 0 auto;
}
.clouds {
display: block;
-webkit-animation: verticalScroll 3s infinite ease-in;
-moz-animation: verticalScroll 3s infinite ease-in;
animation: verticalScroll 3s infinite ease-in;
}
#rocket {
-webkit-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-animation: takeOff 3s infinite ease-in;
animation: takeOff 3s infinite ease-in;
}
.flame-outer {
-webkit-animation: outerFlame .5s infinite linear;
-moz-animation: outerFlame .5s infinite linear;
animation: outerFlame .5s infinite linear;
}
.flame-inner {
-webkit-animation: innerFlame .5s infinite linear;
-moz-animation: innerFlame .5s infinite linear;
-ms-animation: innerFlame .5s infinite linear;
animation: innerFlame .5s infinite linear;
}
@-webkit-keyframes verticalScroll {
0% { -webkit-transform: translateY(0) }
100% { -webkit-transform: translateY(500px) }
}
@-moz-keyframes verticalScroll {
0% { -moz-transform: translateY(0) }
100% { -moz-transform: translateY(500px) }
}
@keyframes verticalScroll {
0% { transform: translateY(0) }
100% { transform: translateY(500px) }
}
@-webkit-keyframes takeOff {
0% { -webkit-transform: scale(1) translateY(0); }
100% { -webkit-transform: scale(0) translateY(-500px); }
}
@-moz-keyframes takeOff {
0% {
-moz-transform: scale(1) translateY(0); }
100% {-moz-transform: scale(0) translateY(-500px); }
}
@keyframes takeOff {
0% {
transform: scale(1) translateY(0);
}
100% {
transform: scale(0) translateY(-500px); }
}
@-webkit-keyframes outerFlame {
0% { fill: red}
33% { fill: orange }
66% {fill: yellow }
75% { fill: orange}
100% {fill: red }
}
@-moz-keyframes outerFlame {
0% { fill: red}
33% { fill: orange }
66% {fill: yellow }
75% { fill: orange}
100% {fill: red }
}
@keyframes outerFlame {
0% { fill: red}
33% { fill: orange }
66% {fill: yellow }
75% { fill: orange}
100% {fill: red }
}
@-webkit-keyframes innerFlame {
0% { fill: orange}
33% { fill: yellow }
66% {fill: orange }
100% {fill: red }
}
@-moz-keyframes innerFlame {
0% { fill: orange}
33% { fill: yellow }
66% {fill: orange }
100% {fill: red }
}
@keyframes innerFlame {
0% { fill: orange}
33% { fill: yellow }
66% {fill: orange }
100% {fill: red }
}
Also see: Tab Triggers