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="wrapper">
<svg class="kraken">
<g id="eyes">
<path d="M259.815 118.594c-15.48 0-28.074 12.594-28.074 28.074s12.594 28.074 28.074 28.074 28.074-12.594 28.074-28.074-12.594-28.074-28.074-28.074zm0 41.148c-7.209 0-13.074-5.865-13.074-13.074s5.865-13.074 13.074-13.074 13.074 5.865 13.074 13.074-5.865 13.074-13.074 13.074z M188.663 118.594c-15.48 0-28.074 12.594-28.074 28.074s12.594 28.074 28.074 28.074 28.074-12.594 28.074-28.074-12.594-28.074-28.074-28.074zm0 41.148c-7.209 0-13.074-5.865-13.074-13.074s5.865-13.074 13.074-13.074 13.074 5.865 13.074 13.074-5.865 13.074-13.074 13.074z"/>
</g>
<g id="body">
<path d="M440.978 52.915c-9.953 0-15.276 3.438-19.553 6.2-3.543 2.289-5.885 3.8-11.416 3.8s-7.872-1.512-11.415-3.8c-4.277-2.762-9.6-6.2-19.553-6.2-9.953 0-15.275 3.438-19.551 6.2-3.542 2.289-5.883 3.8-11.413 3.8s-7.87-1.512-11.413-3.8c-4.277-2.762-9.599-6.2-19.552-6.2-1.422 0-2.739.077-3.983.205C295.808 21.837 262.458.607 224.238.607c-38.221 0-71.572 21.231-88.893 52.516a38.49 38.49 0 00-4.004-.208c-9.952 0-15.274 3.438-19.55 6.2-3.542 2.288-5.883 3.8-11.411 3.8s-7.869-1.512-11.411-3.8c-4.276-2.762-9.598-6.2-19.55-6.2s-15.273 3.438-19.55 6.2c-3.542 2.288-5.882 3.8-11.41 3.8s-7.869-1.512-11.411-3.8c-4.276-2.762-9.598-6.2-19.55-6.2a7.5 7.5 0 000 15c5.528 0 7.869 1.512 11.411 3.8 4.276 2.762 9.598 6.2 19.55 6.2s15.273-3.438 19.55-6.2c3.542-2.288 5.882-3.8 11.41-3.8s7.868 1.512 11.41 3.8c4.276 2.762 9.598 6.2 19.55 6.2s15.274-3.438 19.55-6.2c2.891-1.868 4.984-3.217 8.661-3.65a101.063 101.063 0 00-5.89 34.079c0 19.215 5.362 41.228 15.098 61.983 9.717 20.716 14.645 42.292 14.645 64.131v60.893c0 6.428-4.966 11.899-11.071 12.196a11.563 11.563 0 01-8.624-3.205c-2.337-2.227-3.625-5.224-3.625-8.44V266.32c0-13.05-10.372-23.864-23.12-24.105-6.38-.128-12.406 2.274-16.961 6.744-4.557 4.471-7.066 10.446-7.066 16.825v22.954c0 32.198 25.745 59.002 57.389 59.753 15.962.38 31.047-5.563 42.482-16.731a60.404 60.404 0 002.741-2.882v60.179c0 3.214-1.288 6.21-3.627 8.437-2.337 2.226-5.402 3.359-8.632 3.206-6.099-.297-11.06-5.768-11.06-12.195v-10.583c0-6.374-2.506-12.344-7.057-16.811-4.554-4.47-10.56-6.847-16.956-6.749-12.756.223-23.134 11.034-23.134 24.1v10.596c0 15.95 6.3 30.888 17.739 42.06 11.091 10.833 25.62 16.748 41.05 16.748.476 0 .953-.005 1.43-.017 21.206-.506 39.75-12.719 49.686-30.403a59.192 59.192 0 0010.446 13.677c11.092 10.833 25.62 16.748 41.051 16.748.476 0 .953-.005 1.43-.017 31.646-.755 57.393-27.562 57.393-59.756v-10.171c0-6.377-2.506-12.35-7.056-16.816-4.55-4.466-10.588-6.839-16.943-6.743-12.764.223-23.147 11.033-23.147 24.1v10.596c0 3.214-1.288 6.21-3.626 8.438a11.61 11.61 0 01-8.632 3.205c-6.099-.297-11.06-5.768-11.06-12.195v-60.098c10.503 11.961 25.617 19.68 42.39 20.078.479.011.957.017 1.435.017 15.428 0 29.956-5.916 41.048-16.748 11.44-11.172 17.741-26.109 17.741-42.059V266.32c0-13.05-10.372-23.864-23.12-24.105-6.376-.121-12.406 2.274-16.962 6.744-4.556 4.471-7.065 10.446-7.065 16.825v23.366c0 6.428-4.966 11.899-11.071 12.196a11.56 11.56 0 01-8.624-3.205c-2.337-2.227-3.625-5.224-3.625-8.44v-61.444c0-21.838 4.927-43.415 14.645-64.131 9.736-20.755 15.098-42.768 15.098-61.983a101.07 101.07 0 00-5.889-34.076c3.665.436 5.754 1.784 8.64 3.649 4.277 2.762 9.599 6.2 19.552 6.2s15.275-3.438 19.551-6.2c3.542-2.289 5.883-3.8 11.413-3.8 5.531 0 7.872 1.512 11.416 3.8 4.277 2.762 9.6 6.2 19.553 6.2 9.954 0 15.276-3.438 19.553-6.2 3.543-2.289 5.884-3.8 11.415-3.8 4.142 0 7.5-3.358 7.5-7.5s-3.357-7.501-7.499-7.501zM224.239 15.607c31.729 0 59.52 17.169 74.583 42.701-.431.272-.853.543-1.261.807-3.542 2.289-5.883 3.8-11.413 3.8s-7.87-1.512-11.412-3.8c-4.276-2.763-9.599-6.2-19.551-6.2-9.952 0-15.273 3.438-19.55 6.2-3.542 2.288-5.882 3.8-11.41 3.8-5.527 0-7.867-1.512-11.409-3.8-4.276-2.762-9.598-6.2-19.549-6.2-9.952 0-15.274 3.438-19.551 6.2-3.542 2.289-5.883 3.8-11.413 3.8-5.529 0-7.869-1.512-11.412-3.8-.403-.26-.819-.528-1.244-.796 15.064-25.538 42.858-42.712 74.592-42.712zm72.858 142.149c-10.66 22.724-16.064 46.444-16.064 70.501v61.444c0 7.254 3.018 14.29 8.279 19.301 5.335 5.083 12.333 7.679 19.698 7.326 14.211-.691 25.342-12.63 25.342-27.179v-23.366a8.51 8.51 0 012.571-6.118c1.657-1.626 3.839-2.507 6.172-2.454 4.634.088 8.404 4.174 8.404 9.108V289.7c0 11.875-4.695 23.001-13.221 31.327-8.521 8.321-19.775 12.761-31.647 12.466-23.569-.559-42.745-20.637-42.745-44.757V217.42a7.5 7.5 0 00-15 0v171.088c0 14.547 11.126 26.485 25.327 27.178 7.377.361 14.368-2.239 19.708-7.324 5.265-5.012 8.284-12.047 8.284-19.301v-10.596c0-4.938 3.772-9.021 8.417-9.102 2.341-.027 4.513.827 6.166 2.45a8.5 8.5 0 012.564 6.112v10.171c0 24.118-19.178 44.197-42.749 44.76-11.89.285-23.125-4.147-31.644-12.467-8.525-8.326-13.22-19.452-13.22-31.329l.001-162.306a7.5 7.5 0 00-15 0l-.001 161.375c-.021 24.101-19.19 44.158-42.749 44.72-11.876.268-23.125-4.146-31.643-12.466-8.525-8.326-13.22-19.453-13.22-31.329v-10.596c0-4.938 3.766-9.021 8.403-9.102 2.327-.033 4.521.829 6.179 2.456a8.493 8.493 0 012.564 6.106v10.583c0 14.548 11.126 26.486 25.327 27.177 7.373.367 14.368-2.239 19.708-7.324 5.265-5.012 8.284-12.047 8.284-19.301V217.422a7.5 7.5 0 00-15 0v72.279c0 11.875-4.695 23.001-13.221 31.327-8.521 8.32-19.755 12.766-31.647 12.466-23.569-.559-42.745-20.637-42.745-44.757v-22.954c0-2.318.913-4.491 2.571-6.119a8.506 8.506 0 016.171-2.453c4.634.088 8.404 4.174 8.404 9.108V289.7c0 7.254 3.018 14.29 8.279 19.301 5.335 5.083 12.331 7.679 19.698 7.326 14.211-.691 25.342-12.63 25.342-27.179v-60.893c0-24.057-5.405-47.777-16.064-70.501-8.82-18.803-13.678-38.553-13.678-55.613a86.123 86.123 0 015.434-30.182c4.213 2.717 9.508 5.954 19.167 5.954 9.953 0 15.275-3.438 19.551-6.2 3.542-2.288 5.883-3.8 11.412-3.8 5.528 0 7.868 1.512 11.41 3.8 4.276 2.762 9.598 6.2 19.549 6.2 9.952 0 15.273-3.438 19.549-6.2 3.542-2.288 5.882-3.8 11.41-3.8 5.529 0 7.87 1.512 11.412 3.8 4.276 2.763 9.599 6.2 19.551 6.2 9.675 0 14.971-3.247 19.187-5.965a86.115 86.115 0 015.439 30.193c.002 17.062-4.856 36.812-13.676 55.615z"/>
</g>
</svg>
</div>
<div>Icon made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from
<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
.wrapper {
width: 448px;
margin: 0 auto;
}
.kraken {
width: 448px;
height: 448px;
}
g#eyes {
transform: translate(0px, 0px);
animation-duration: 3s;
animation-name: bobble;
animation-iteration-count: infinite;
}
@keyframes bobble {
0% {
transform: translate(0px, 0px);
}
33% {
transform: translate(8px, 0px);
}
67% {
transform: translate(-8px, 0px);
}
100% {
transform: translate(0px, 0px);
}
}
Also see: Tab Triggers