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="wb">
<div class="wb__cap"></div>
<div class="wb__mouth"></div>
<div class="wb__neck"></div>
<div class="wb__top"></div>
<div class="wb__middle1"></div>
<div class="wb__middle2"></div>
<div class="wb__middle3"></div>
<div class="wb__middle4"></div>
<div class="wb__middle5"></div>
<div class="wb__middle6"></div>
<div class="wb__middle7"></div>
<div class="wb__middle8"></div>
<div class="wb__middle9"></div>
<div class="wb__bottom"></div>
<div class="wb__water"></div>
</div>
* {
border: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
font-size: calc(16px + (24 - 16) * (100vw - 320px) / (1280 - 320));
}
body {
background: url(https://i.ibb.co/DtPjB5n/grass.jpg) 0 0 / 20em 20em;
display: flex;
font: 1em/1.5 sans-serif;
height: 100vh;
padding: 1.5em 0;
}
.wb, .wb__cap, .wb__mouth, .wb__neck, .wb__top {
margin: auto;
}
.wb {
position: relative;
width: 9em;
height: 28em;
}
.wb__cap {
background:
linear-gradient(90deg,#001329aa,#00132900 33% 67%,#001329aa),
radial-gradient(60% 8% at 50% 4%,#b6cafb,#b6cafb00 50%),
linear-gradient(90deg,#5583f600 30%,#5583f6 50%,#5583f600 70%) 0 100% / 100% 0.2em,
repeating-linear-gradient(90deg,#0000 0 0.1em,#0d4ef2 0.1em 0.2em,#0000 0.2em) 0 0.1em / 100% 0.7em,
linear-gradient(#0b46da 0.1em,#0000 0.1em 0.2em,#0d4ef2 0.2em 0.6em,#0000 0.6em 0.7em,#0d4ef2 0.7em 0.8em,#0000 0.8em 1em,#0b46da 1em) 0 0.9em / 100% 1.25em,
radial-gradient(40% 25% at 50% 90%,#b6cafb,#b6cafb00 50%),
radial-gradient(40% 200% at 50% 90%,#5583f6,#5583f600 50%),
#255ff4;
background-repeat: no-repeat;
border-radius: 0.25em 0.25em 0 0;
width: 3em;
height: 2.15em;
}
.wb__mouth {
border-radius: 0.25em 0.25em 0.125em 0.125em;
box-shadow:
0 0.2em 0.1em #051433 inset,
0 -0.25em 0.15em #aac4dd inset;
width: 3.5em;
height: 0.3em;
}
.wb div:nth-child(n + 3):nth-child(-n + 14) {
--blur1: 1px;
backdrop-filter: blur(var(--blur1));
-webkit-backdrop-filter: blur(var(--blur1));
}
.wb__neck {
background:
linear-gradient(90deg,#051433 0.15em,#05143300 0.25em 2.75em,#051433 2.85em),
linear-gradient(90deg,#fff0 12.5%,#fff6 12.5% 40%,#fff0 40% 55%,#fff6 55% 80%,#fff0 80%),
linear-gradient(0deg,#05143322,#05143300 0.2em),
linear-gradient(90deg,#aac4dd00,#aac4dd77) -3em 0 / 9em 100%;
width: 3em;
height: 0.8em;
}
.wb__top {
background:
radial-gradient(125% 125% at center,#fff7,#fff0 50%) 4.4em 0.25em / 0.75em 0.3em no-repeat,
linear-gradient(132deg,#051433 1.35em,#05143300 1.4em) 0 100% / 100% 60% no-repeat,
linear-gradient(-132deg,#051433 1.35em,#05143300 1.4em) 0 100% / 100% 60% no-repeat,
linear-gradient(132deg,#05143377 24%,#05143300 27%),
linear-gradient(-132deg,#05143377 24%,#05143300 27%),
linear-gradient(#05143300 37%,#05143377 38% 42%,#aac4dd77 43%,#aac4dd00 44%),
linear-gradient(90deg,#aac4dd00,#aac4dd77);
clip-path: polygon(2.75em 0em,5.75em 0em,8.5em 3em,0em 3em);
width: 8.5em;
height: 3em;
}
.wb__middle1 {
background:
radial-gradient(200% 400% at 100% 100%,#05143300 28%,#051433 33% 50%) 0 0 / 0.75em 0.625em,
radial-gradient(200% 400% at 100% 0,#05143300 28%,#051433 33% 50%) 0 100% / 0.75em 0.625em,
linear-gradient(90deg,#051433 0.25em,#05143300 0.3em 8.7em,#051433 8.75em) 0 0.625em / 100% calc(100% - 1.25em),
radial-gradient(200% 400% at 0 100%,#05143300 28%,#051433 33% 50%) 100% 0 / 0.75em 0.625em,
radial-gradient(200% 400% at 0 0,#05143300 28%,#051433 33% 50%) 100% 100% / 0.75em 0.625em,
radial-gradient(2.5em 1.25em at 2.375em 100%,#fff4 49%,#fff0 50%) 0 0 / 100% 0.625em,
radial-gradient(3em 1.25em at 7.35em 100%,#fff4 49%,#fff0 50%) 0 0 / 100% 0.625em,
linear-gradient(90deg,#fff0 55%,#fff3 57%,#fff0 59%) 0 0 / 100% 100%,
linear-gradient(90deg,#fff0 12.5%,#fff4 12.5% 40%,#fff0 40% 65%,#fff4 65%) 0 100% / 100% calc(100% - 0.625em),
linear-gradient(90deg,#aac4dd00,#aac4dd77);
border-radius: 0.3em 0.3em 0.5em 0.5em / 0.75em 0.75em 0.5em 0.5em;
height: 2.25em;
}
.wb__middle4 {
background:
radial-gradient(200% 400% at 100% 100%,#05143300 28%,#051433 33% 50%) 0 0 / 0.75em 0.625em,
radial-gradient(200% 400% at 100% 0,#05143300 28%,#051433 33% 50%) 0 100% / 0.75em 0.625em,
linear-gradient(90deg,#051433 0.25em,#05143300 0.3em 8.7em,#051433 8.75em) 0 0.625em / 100% calc(100% - 1.25em),
radial-gradient(200% 400% at 0 100%,#05143300 28%,#051433 33% 50%) 100% 0 / 0.75em 0.625em,
radial-gradient(200% 400% at 0 0,#05143300 28%,#051433 33% 50%) 100% 100% / 0.75em 0.625em,
linear-gradient(90deg,#fff0 55%,#fff3 57%,#fff0 59%) 0 0 / 100% 100%,
linear-gradient(90deg,#fff0 12.5%,#fff4 12.5% 40%,#fff0 40% 65%,#fff4 65%),
linear-gradient(90deg,#aac4dd00,#aac4dd77);
height: 7em;
}
.wb__middle1, .wb__middle4 {
background-repeat: no-repeat;
box-shadow: 0 -0.1em 0 #05143322 inset;
}
.wb div:nth-child(n + 6):nth-child(-n + 13) {
border-radius: 0.5em;
}
.wb div:nth-child(n + 6):nth-child(-n + 7), .wb div:nth-child(n + 9):nth-child(-n + 13) {
background:
radial-gradient(200% 200% at 100% 50%,#05143300 28%,#051433 33% 50%) 0 0 / 0.75em 1.25em,
radial-gradient(200% 200% at 0 50%,#05143300 28%,#051433 33% 50%) 100% 0 / 0.75em 1.25em,
linear-gradient(90deg,#fff0 55%,#fff3 57%,#fff0 59%) 0 0 / 100% 100%,
linear-gradient(90deg,#aac4dd00 12.5%,#fff4 12.5% 40%,#fff0 40% 65%,#fff4 65%),
linear-gradient(90deg,#aac4dd00,#aac4dd77);
background-repeat: no-repeat;
box-shadow:
0 0.1em 0 #aac4dd33 inset,
0 -0.1em 0 #05143322 inset;
height: 1.25em;
}
.wb__bottom {
background:
radial-gradient(200% 400% at 100% 100%,#05143300 28%,#051433 33% 50%) 0 0 / 0.75em 1em,
radial-gradient(200% 400% at 0 100%,#05143300 28%,#051433 33% 50%) 100% 0 / 0.75em 1em,
radial-gradient(200% 400% at 100% 0,#05143300 28%,#051433 33% 50%) 0 100% / 0.75em 2.8em,
radial-gradient(200% 400% at 0 0,#05143300 28%,#051433 33% 50%) 100% 100% / 0.75em 2.8em,
linear-gradient(#fff4,#fff0) 1.125em 0 / 2.5em 75%,
linear-gradient(#fff4,#fff0) 5.85em 0 / 3.15em 75%,
linear-gradient(90deg,#aac4dd00,#aac4dd77);
background-repeat: no-repeat;
border-radius: 0.5em 0.5em 0.75em 0.75em / 0.5em 0.5em 3.25em 3.25em;
box-shadow:
0 0.1em 0 #aac4dd33 inset,
0 -0.25em 0.125em #05143344 inset;
height: 3.75em;
}
.wb__water {
--blur2: 2px;
backdrop-filter: blur(var(--blur2));
-webkit-backdrop-filter: blur(var(--blur2));
clip-path: polygon(1.75em 0em,6.75em 0em,8.5em 2em,8.5em 22.75em,8em 23.5em,0.5em 23.5em,0 22.75em,0em 2em);
position: absolute;
bottom: 0;
left: 0.25em;
width: 8.5em;
height: 23.5em;
z-index: -1;
}
Also see: Tab Triggers