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 id="snow"></div>
<svg width="1163px" height="1296px" viewBox="63 28 1163 1296" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect id="base" stroke="none" fill="#8E550F" fill-rule="evenodd" x="541" y="1153" width="242" height="171"></rect>
<path d="M674.585992,142 C674.585992,142 614.37253,171.447011 614.007148,183.025055 C613.655271,194.17517 732.364815,191.223748 732.124198,203.082398 C731.856523,216.274629 566.053305,249.975836 565.560219,263.987246 C565.097978,277.122143 742.572873,267.189846 742.397936,280.89442 C742.17132,298.647452 546.557216,341.685733 545.869285,360.348146 C545.226266,377.792192 802.005422,381.910666 801.965627,399.858494 C801.915908,422.281727 492.722165,455.227875 491.345671,478.289129 C489.650945,506.681909 863.373944,515.739492 864.402732,544.433154 C865.213839,567.055574 404.664506,616.972084 402.836399,639.690068 C400.987439,662.667191 970.476589,666.605333 972.303147,689.017331 C974.616064,717.396994 339.30716,755.255509 332.795111,782.722953 C325.084507,815.245833 1040.3809,843.161248 1049.53938,873.049996 C1059.62067,905.950328 282.753182,956.579988 259.289589,985.385392 C239.204112,1010.0436 1122.69493,1032.86137 1145.57526,1052.19351 C1168.04375,1071.17768 429.514311,1120.47693 332.795111,1132.50406 C74.9070423,1164.5727 103.818505,1148.69062 103.818505,1148.69062" id="tree" stroke="#29882F" stroke-width="22" stroke-linecap="square" fill="none"></path>
<polygon id="star" stroke="none" fill="#EFF019" fill-rule="evenodd" points="673.5 136.75 630.885569 159.153732 639.024201 111.701866 604.548403 78.0962679 652.192785 71.173134 673.5 28 694.807215 71.173134 742.451597 78.0962679 707.975799 111.701866 716.114431 159.153732"></polygon>
<circle id="blu5" stroke="none" fill="#168BAF" fill-rule="evenodd" cx="541" cy="1041" r="40"></circle>
<circle id="blu4" stroke="none" fill="#168BAF" fill-rule="evenodd" cx="239" cy="1001" r="40"></circle>
<circle id="blu3" stroke="none" fill="#168BAF" fill-rule="evenodd" cx="1050" cy="889" r="40"></circle>
<circle id="blu2" stroke="none" fill="#168BAF" fill-rule="evenodd" cx="757" cy="769" r="40"></circle>
<circle id="blu1" stroke="none" fill="#168BAF" fill-rule="evenodd" cx="517" cy="374" r="40"></circle>
<circle id="yel7" stroke="none" fill="#EFF119" fill-rule="evenodd" cx="103" cy="1153" r="40"></circle>
<circle id="yel6" stroke="none" fill="#EFF119" fill-rule="evenodd" cx="1186" cy="1062" r="40"></circle>
<circle id="yel5" stroke="none" fill="#EFF119" fill-rule="evenodd" cx="541" cy="849" r="40"></circle>
<circle id="yel4" stroke="none" fill="#EFF119" fill-rule="evenodd" cx="381" cy="647" r="40"></circle>
<circle id="yel3" stroke="none" fill="#EFF119" fill-rule="evenodd" cx="864" cy="534" r="40"></circle>
<circle id="yel2" stroke="none" fill="#EFF119" fill-rule="evenodd" cx="646" cy="534" r="40"></circle>
<circle id="yel1" stroke="none" fill="#EFF119" fill-rule="evenodd" cx="726" cy="300" r="40"></circle>
<circle id="red6" stroke="none" fill="#C30E0E" fill-rule="evenodd" cx="846" cy="942" r="40"></circle>
<circle id="red5" stroke="none" fill="#C30E0E" fill-rule="evenodd" cx="301" cy="788" r="40"></circle>
<circle id="red4" stroke="none" fill="#C30E0E" fill-rule="evenodd" cx="970" cy="708" r="40"></circle>
<circle id="red3" stroke="none" fill="#C30E0E" fill-rule="evenodd" cx="477" cy="494" r="40"></circle>
<circle id="red2" stroke="none" fill="#C30E0E" fill-rule="evenodd" cx="806" cy="414" r="40"></circle>
<circle id="red1" stroke="none" fill="#C30E0E" fill-rule="evenodd" cx="569" cy="260" r="40"></circle>
</svg>
body {
background: #000;
}
#snow{
background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/807677/snow1.png'),
url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/807677/snow2.png'),
url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/807677/snow3.png');
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index:-1;
animation: snow 10s linear infinite;
}
svg {
max-width: 85%;
max-height: 85%;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
svg path {
fill-opacity: 0;
stroke: #29882F;
stroke-width: 20;
stroke-dasharray: 85;
stroke-dashoffset: 1000;
animation: draw 1s infinite linear;
}
#star{
animation: star-morph 3s infinite linear;
}
#red1, #red2, #red3, #red4, #red5, #red6 {
animation: color-morph 3s infinite linear;
}
#yel1, #yel2, #yel3, #yel4, #yel5, #yel6, #yel7 {
animation: color-morph 3s infinite linear;
animation-delay: 1s;
}
#blu1, #blu2, #blu3, #blu4, #blu5 {
animation: color-morph 3s infinite linear;
animation-delay: 2s;
}
@keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
50% {background-position: 500px 500px, 100px 200px, -100px 150px;}
100% {background-position: 500px 1000px, 200px 400px, -100px 300px;}
}
@keyframes draw {
to {
stroke-dashoffset: 0;
}
}
@keyframes star-morph {
0% {opacity: .4}
33% {opacity: .6}
66% {opacity: 1}
}
@keyframes color-morph {
0% {fill: #EFF119}
33% {fill: #C30E0E}
66% {fill: #168BAF}
}
Also see: Tab Triggers