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.
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" viewBox="0 0 800 800">
<defs>
<radialGradient id="ccclaymoji-grad-dark" r="93%" cx="20%" cy="20%">
<stop offset="70%" stop-color="hsl(41, 100%, 67%)" stop-opacity="0"></stop>
<stop offset="97%" stop-color="hsl(42.83,69.22%,46.44%)" stop-opacity="1"></stop>
</radialGradient>
<radialGradient id="ccclaymoji-grad-light" r="65%" cx="28%" cy="20%">
<stop offset="0%" stop-color="hsl(58.93,100%,76.62%)" stop-opacity="0.75"></stop>
<stop offset="100%" stop-color="hsl(41, 100%, 67%)" stop-opacity="0"></stop>
</radialGradient>
<filter id="ccclaymoji-blur" x="-100%" y="-100%" width="400%" height="400%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feGaussianBlur stdDeviation="30" x="0%" y="0%" width="100%" height="100%" in="SourceGraphic" edgeMode="none" result="blur"></feGaussianBlur>
</filter>
<filter id="inner-blur" x="-100%" y="-100%" width="400%" height="400%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feGaussianBlur stdDeviation="2" x="0%" y="0%" width="100%" height="100%" in="SourceGraphic" edgeMode="none" result="blur"></feGaussianBlur>
</filter>
<filter id="eye-shadow" x="-100%" y="-100%" width="400%" height="400%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feDropShadow stdDeviation="10" dx="10" dy="10" flood-color="hsl(0,0%,0%)" flood-opacity="0.2" x="0%" y="0%" width="100%" height="100%" result="dropShadow"></feDropShadow>
</filter>
<linearGradient gradientTransform="rotate(-25)" id="eye-light" x1="50%" y1="0%" x2="50%" y2="100%">
<stop offset="20%" stop-color="hsl(339.45,0%,33.2%)" stop-opacity="1"></stop>
<stop offset="100%" stop-color="black" stop-opacity="0"></stop>
</linearGradient>
<linearGradient id="mouth-light" x1="50%" y1="0%" x2="50%" y2="100%">
<stop offset="0%" stop-color="hsl(18.46,100%,70.18%)" stop-opacity="1"></stop>
<stop offset="100%" stop-color="hsl(3, 100%, 51%)" stop-opacity="0"></stop>
</linearGradient>
<filter id="mouth-shadow" x="-100%" y="-100%" width="400%" height="400%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feDropShadow stdDeviation="10" dx="10" dy="10" flood-color="hsl(0,100%,38.12%)" flood-opacity="0.2" x="0%" y="0%" width="100%" height="100%" result="dropShadow"></feDropShadow>
</filter>
</defs>
<g stroke-linecap="round">
<path d="M699 449.99998478233977C699 602.9582058065985 601.9582210242588 726.9541626799139 449 726.9541626799139C296.04245283018867 726.9541626799139 199 602.9582058065985 199 449.99998478233977C199 297.04243761252843 296.04245283018867 173.04580688476562 449 173.04580688476562C601.9582210242588 173.04580688476562 699 297.04243761252843 699 449.99998478233977Z " fill="hsl(42.83,69.22%,46.44%)" opacity="0.25" filter="url(#ccclaymoji-blur)"></path>
<path d="M650 399.99999613096236C650 561.6737853047515 561.6737891737891 635.7549818859482 400 635.7549818859482C238.3269230769231 635.7549818859482 150 561.6737853047515 150 399.99999613096236C150 238.3269192078854 238.3269230769231 164.24501037597656 400 164.24501037597656C561.6737891737891 164.24501037597656 650 238.3269192078854 650 399.99999613096236Z " fill="hsl(41, 100%, 67%)"></path>
<path d="M650 399.99999613096236C650 561.6737853047515 561.6737891737891 635.7549818859482 400 635.7549818859482C238.3269230769231 635.7549818859482 150 561.6737853047515 150 399.99999613096236C150 238.3269192078854 238.3269230769231 164.24501037597656 400 164.24501037597656C561.6737891737891 164.24501037597656 650 238.3269192078854 650 399.99999613096236Z " fill="url(#ccclaymoji-grad-dark)"></path>
<path d="M650 399.99999613096236C650 561.6737853047515 561.6737891737891 635.7549818859482 400 635.7549818859482C238.3269230769231 635.7549818859482 150 561.6737853047515 150 399.99999613096236C150 238.3269192078854 238.3269230769231 164.24501037597656 400 164.24501037597656C561.6737891737891 164.24501037597656 650 238.3269192078854 650 399.99999613096236Z " fill="url(#ccclaymoji-grad-light)"></path>
<ellipse rx="23.5" ry="25" cx="350" cy="375" fill="black" filter="url(#eye-shadow)"></ellipse>
<ellipse rx="23.5" ry="25" cx="350" cy="375" fill="url(#eye-light)" filter="url(#inner-blur)"></ellipse>
<ellipse rx="23.5" ry="25" cx="450" cy="375" fill="black" filter="url(#eye-shadow)"></ellipse>
<ellipse rx="23.5" ry="25" cx="450" cy="375" fill="url(#eye-light)" filter="url(#inner-blur)"></ellipse>
<path d="M359 491.5Q409 541.5 459 491.5 " stroke-width="20" stroke="hsl(3, 100%, 51%)" fill="none" filter="url(#mouth-shadow)" transform="rotate(20, 400, 400)"></path>
<path d="M359 491.5Q409 541.5 459 491.5 " stroke-width="6.666666666666667" stroke="url(#mouth-light)" fill="none" filter="url(#inner-blur)" transform="rotate(20, 400, 400)"></path>
</g>
</svg>
<article id="red">
<h2>Red card</h2>
<p>This is a paragraph that has all sorts of words and stuff that you can read, providing you can read the English language.</p>
<button>I'm a button</button>
<button>I'm also a button</button>
</article>
<article id="blue">
<h2>Dark Blue card</h2>
<p>Oh look, another paragraph written in English.</p>
<button>I'm a button</button>
<button>I'm also a button</button>
</article>
<article id="purple">
<h2>Light Blue card</h2>
<p>And here's another paragraph, also shockingly written in English.</p>
<button>I'm a button</button>
<button>I'm also a button</button>
</article>
<article id="cyan">
<h2>Cyan card</h2>
<p>Ok, hold up ... another paragraph written in English. This is too much.</p>
<button>I'm a button</button>
<button>I'm also a button</button>
</article>
<article id="orange">
<h2>Orange card</h2>
<p>What did I just say about this being too much!? Ay caramba!</p>
<button>I'm a button</button>
<button>I'm also a button</button>
</article>
:root {
--color-text: #121212;
--color-yellow: #fbe8a6;
--color-yellow-alt: #e6c513;
--color-yellow-tint: #cfb011;
--color-red: #f76d6d;
--color-red-tint: #f53d3d;
--color-orange: #f4976c;
--color-cyan: #a8d1e7;
--color-white: #f5f5f5;
--color-blue: #24315e;
--color-purple: #7b68ee;
--clay-background: rgba(0, 0, 0, 0.005);
--clay-border-radius: 32px;
--clay-shadow-outset: 8px 8px 16px 0 rgba(0, 0, 0, 0.25);
--clay-shadow-inset-primary: -8px -8px 16px 0 rgba(0, 0, 0, 0.25);
--clay-shadow-inset-secondary: 8px 8px 16px 0 rgba(0, 0, 100, 0.2);
--clay-margin: 1em;
--clay-padding: 2em 2em 2.5em;
}
html {
font-family: sans-serif;
}
body {
background: #eee;
}
article, button {
background: var(--clay-background);
border-radius: var(--clay-border-radius);
box-shadow:
var(--clay-shadow-outset),
inset var(--clay-shadow-inset-primary),
inset var(--clay-shadow-inset-secondary);
color: var(--color-white);
margin: var(--clay-margin);
padding: var(--clay-padding);
transition: all 0.15s ease;}
#red {
--clay-background: var(--color-red);
}
#blue {
--clay-background: var(--color-blue);
}
#cyan {
--clay-background: var(--color-cyan);--color-white:#222;
}
#orange {
--clay-background: var(--color-orange);
}
#purple {
--clay-background: var(--color-purple);
}
svg {
width: 15%;
display: block;
margin: auto;
min-width: 150px;
}
button {
--clay-background: white;
--clay-border-radius: 1rem;
--clay-shadow-outset: 4px 4px 8px 0 rgba(0, 0, 0, 0.25);
--clay-shadow-inset-primary: -8px -8px 12px 0 var(--clay-background));
--clay-shadow-inset-secondary: 8px 8px 12px 0 var(--clay-background);
color: #202124;
cursor: pointer;
display: inline-flex;
font-weight: 700;
justify-content: center;
line-height: 1;
padding: 1.5rem 2rem;
text-decoration: none;
text-transform: uppercase;
transition: all 0.15s ease;
border: none;
display: inline-block;
position: relative;
margin: 1rem;
text-align: center;
}
article:hover {
transform: scale(1.005);
}
button:hover {
transform: scale(1.1);
}
Also see: Tab Triggers