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="container">
<svg viewBox="0 0 575 549" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Octo</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Artboard" transform="translate(-15.000000, -25.000000)">
<g id="Octo" transform="translate(0.000000, 31.875000)">
<g id="Leg-6" transform="translate(525.250000, 178.750000)" stroke="#FFF466" stroke-width="13.75" stroke-linecap="round" stroke-linejoin="round">
<path d="M95.2974472,66 C111.011358,66 123.75,78.30883 123.75,93.5 L123.75,93.5 C123.75,108.687831 111.01739,121 95.2906928,121" id="Leg-6b" transform="translate(30.250000, 93.500000) rotate(-270.000000) translate(-30.250000, -93.500000) " class="leg"></path>
<path d="M2.75,158.176868 L2.75,85.25" id="Leg-6a" class="leg"></path>
</g>
<g id="Leg-5" transform="translate(352.000000, 305.250000)" stroke="#FFF466" stroke-width="13.75" stroke-linecap="round" stroke-linejoin="round" class="leg">
<path d="M199.576416,79.75 L118.222646,79.75 C96.9747903,79.75 79.75,62.517638 79.75,41.25" id="Leg-5d" transform="translate(139.663208, 60.500000) scale(1, -1) rotate(-270.000000) translate(-139.663208, -60.500000) " class="leg"></path>
<path d="M158.547447,121 C174.261358,121 187,133.30883 187,148.5 L187,148.5 C187,163.687831 174.26739,176 158.540693,176" id="Leg-5c" class="leg"></path>
<path d="M168.419798,228.932508 C157.041459,228.932508 147.817492,219.675203 147.817492,208.307508 C147.817492,196.916635 157.032685,187.682508 168.432508,187.682508" id="Leg-5b" transform="translate(158.125000, 208.307508) rotate(-90.000000) translate(-158.125000, -208.307508) " class="leg"></path>
<path d="M137.5,196.625 C137.5,185.234127 146.715193,176 158.115016,176" id="Leg-5a" class="leg"></path>
</g>
<g id="Leg-4" transform="translate(61.500000, 283.250000)" stroke="#FFF466" stroke-width="13.75" stroke-linecap="round" stroke-linejoin="round" class="leg">
<path d="M173.625,68.75 L114.472646,68.75 C93.2247903,68.75 76,51.517638 76,30.25" id="Leg-4d" class="leg"></path>
<path d="M372.996231,68.75 L338.826416,68.75 L174.972646,68.75 C153.72479,68.75 136.5,51.517638 136.5,30.25" id="Leg-4c" transform="translate(254.748116, 49.500000) scale(1, -1) rotate(-180.000000) translate(-254.748116, -49.500000) " class="leg"></path>
<path d="M113.547447,66 C129.261358,66 142,78.30883 142,93.5 L142,93.5 C142,108.687831 129.26739,121 113.540693,121" id="Leg-4b" transform="translate(48.500000, 93.500000) rotate(-90.000000) translate(-48.500000, -93.500000) " class="leg"></path>
<path d="M0.379991875,50.8700081 C0.379991875,39.4791352 9.59518487,30.2450081 20.9950081,30.2450081" id="Leg-4a" transform="translate(10.687500, 40.557508) scale(-1, 1) rotate(-90.000000) translate(-10.687500, -40.557508) " class="leg"></path>
</g>
<g id="Leg-3" transform="translate(212.750000, 264.000000)" stroke="#FFF466" stroke-width="13.75" stroke-linecap="round" stroke-linejoin="round" class="leg">
<path d="M180.472646,209 C159.22479,209 142,191.767638 142,170.5" id="Leg-3e" transform="translate(161.236323, 189.750000) scale(1, -1) rotate(-180.000000) translate(-161.236323, -189.750000) " class="leg"></path>
<path d="M180.472646,170.5 C159.22479,170.5 142,153.267638 142,132" id="Leg-3d" transform="translate(161.236323, 151.250000) scale(1, -1) rotate(-90.000000) translate(-161.236323, -151.250000) " class="leg"></path>
<path d="M140.602307,250.25 C129.223967,250.25 120,240.992695 120,229.625 C120,218.234127 129.215193,209 140.615016,209" id="Leg-3c" class="leg"></path>
<path d="M139.25,270.875 C139.25,259.484127 148.465193,250.25 159.865016,250.25" id="Leg-3b" transform="translate(149.557508, 260.562500) scale(-1, 1) translate(-149.557508, -260.562500) " class="leg"></path>
<path d="M146.177341,132 L38.0910331,132 C17.248177,132 0.351703734,112.947039 0.351703734,89.4167507 L0.351703734,42.5832493 L0.351703734,42.5832493 C0.351703734,19.0651701 17.2470165,0 38.1022227,0 L62.3315344,0 L81.4767037,0" id="Leg-3a" class="leg"></path>
</g>
<g id="Leg-2" transform="translate(0.000000, 67.000000)" stroke="#FFF466" stroke-width="13.75" stroke-linecap="round" stroke-linejoin="round">
<path d="M275,153 L156.722646,153 C135.47479,153 118.25,135.767638 118.25,114.5 C118.25,93.2370371 135.504892,76 156.75492,76" id="Leg-2c" class="leg"></path>
<path d="M158.547447,21 C174.261358,21 187,33.30883 187,48.5 L187,48.5 C187,63.6878306 174.26739,76 158.540693,76" id="Leg-2b" class="leg"></path>
<path d="M158.13683,21 L158.13683,21 L42.6023066,21 C31.2239669,21 22,11.7426948 22,0.375 L22,0.375 L22,0.375" id="Leg-2a" class="leg"></path>
</g>
<g id="Leg-1" transform="translate(231.000000, 0.000000)" stroke="#FFF466" stroke-width="13.75" stroke-linecap="round" stroke-linejoin="round">
<path d="M-0.476276412,41.7262764 C15.2376346,41.7262764 27.9762764,54.0351064 27.9762764,69.2262764" id="Leg-1c" transform="translate(13.750000, 55.476276) rotate(-90.000000) translate(-13.750000, -55.476276) " class="leg"></path>
<path d="M48.1023066,41.25 C36.7239669,41.25 27.5,31.9926948 27.5,20.625 C27.5,9.23412704 36.715193,0 48.1150163,0" id="Leg-1b" transform="translate(37.807508, 20.625000) rotate(-180.000000) translate(-37.807508, -20.625000) " class="leg"></path>
<path d="M0,184.246636 L0,123.753364 C0,93.3758448 24.6222143,68.75 55.0153395,68.75" id="Leg-1a" transform="translate(27.507670, 126.498318) scale(1, -1) translate(-27.507670, -126.498318) " class="leg"></path>
</g>
<g id="Octobody" transform="translate(319.000000, 13.750000)">
<path d="M0,151.239403 L0,110.021195 C0,49.2581666 49.23532,0 110,0 C170.751322,0 220,49.2438228 220,110.021195 L220,164.978805 C220,224.831595 172.228734,273.521631 112.7229,274.966966 L112.75,275 L16.4907444,275 C7.38315776,275 0,267.608877 0,258.519072 L0,151.239403 Z" id="Head" stroke="#FFF466" stroke-width="13.75" stroke-linecap="round" stroke-linejoin="round" class="head"></path>
<path d="M70.1136533,274.988653 C58.7353136,274.988653 49.5113467,265.731348 49.5113467,254.363653" id="Smile" stroke="#FFF466" stroke-width="13.75" stroke-linecap="round" stroke-linejoin="round" transform="translate(59.812500, 264.676153) rotate(-90.000000) translate(-59.812500, -264.676153) " class="smile"></path>
<path d="M77,225.5 C98.2629629,225.5 115.5,208.262963 115.5,187 C115.5,165.737037 98.2629629,148.5 77,148.5 C55.7370371,148.5 38.5,165.737037 38.5,187 C38.5,208.262963 55.7370371,225.5 77,225.5 Z M67.375,211.75 C77.2470899,211.75 85.25,203.74709 85.25,193.875 C85.25,184.00291 77.2470899,176 67.375,176 C57.5029101,176 49.5,184.00291 49.5,193.875 C49.5,203.74709 57.5029101,211.75 67.375,211.75 Z M133.375,68.75 C143.24709,68.75 151.25,60.7470899 151.25,50.875 C151.25,41.0029101 143.24709,33 133.375,33 C123.50291,33 115.5,41.0029101 115.5,50.875 C115.5,60.7470899 123.50291,68.75 133.375,68.75 Z M163.625,79.75 C167.421958,79.75 170.5,76.6719577 170.5,72.875 C170.5,69.0780423 167.421958,66 163.625,66 C159.828042,66 156.75,69.0780423 156.75,72.875 C156.75,76.6719577 159.828042,79.75 163.625,79.75 Z M100.375,74.25 C105.690741,74.25 110,69.9407407 110,64.625 C110,59.3092593 105.690741,55 100.375,55 C95.0592593,55 90.75,59.3092593 90.75,64.625 C90.75,69.9407407 95.0592593,74.25 100.375,74.25 Z" id="Eye-and-Spots" fill="#FFF466" class="eye-spots"></path>
</g>
</g>
</g>
</g>
</svg>
</div>
svg path {
stroke: #FFF466;
stroke-width: 14px;
}
svg {
width: 360px;
}
body {
margin: 0;
background-color: #F1453D;
}
.container {
margin: 0;
padding: 30px;
text-align: center;
}
@keyframes offset {
to {
stroke-dashoffset: 0px;
}
}
@keyframes expand {
0% {
transform: scale(.01);
transform-origin: 20% 40%;
}
100% {
transform: scale(1);
}
}
.eye-spots {
stroke-width: 0;
animation: expand 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}
.leg, .head, .smile {
animation: offset 2s linear forwards;
}
.head {
stroke-dasharray: 1020px;
stroke-dashoffset: 1020px;
}
.leg {
stroke-dasharray: 800px;
stroke-dashoffset: 800px;
animation-delay: 1.75s;
}
.smile {
stroke-dasharray: 80px;
stroke-dashoffset: 80px;
animation-delay: 2s;
}
Also see: Tab Triggers