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.
body {
--skin: lightgray; #da7;
--fur: gray; #963;
--line: #222;
--mouth: #d00;
--ground: #77aa77;
--sky: #ddeeff;
--light: #f4f6f8;
--astro1: #ffe;
--astro2: #ffe;
--star: var(--sky);
/* night mode */
/* --sky: #369;
--astro1: var(--sky);
--star: #ffe;
--skin: #777;
--fur: #444; */
width: 1vmin;
height: 1vmin;
background: var(--light);
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-6vmin, -6vmin);
box-shadow:
/* banana */
27vmin -32.3vmin 0 .6vmin #874a13,
34vmin -32vmin 0 6.5vmin #fff,
32vmin -30vmin 0 5.5vmin #ffdb3c,
31vmin -28vmin 0 5vmin #fdca17,
32vmin -29vmin 0 10vmin #fff,
23vmin -18vmin 0 4vmin #fff,
18vmin -13vmin 0 2vmin #fff,
15vmin -10vmin 0 1vmin #fff,
/* eyes */
0.5vmin 0.5vmin 0 1vmin var(--line),
6vmin 0 var(--light),
6.6vmin 0.5vmin 0 1vmin var(--line),
/* nostrils */
3vmin 3vmin 0 -0.125vmin var(--line),
4vmin 3vmin 0 -0.125vmin var(--line),
/* mouth */
3.5vmin 8vmin 0 1.25vmin var(--skin),
3.5vmin 7vmin 0 1vmin var(--mouth),
/* face */
-0.5vmin -1vmin 0 4vmin var(--skin),
7.5vmin -1vmin 0 4vmin var(--skin),
3.5vmin 5vmin 0 4vmin var(--skin),
/* head */
3.5vmin 0 0 9vmin var(--fur),
/* ears */
-6vmin 1vmin 0 2vmin var(--skin),
13vmin 1vmin 0 2vmin var(--skin),
/* ear lobs */
/* -5vmin 3vmin 0 1vmin var(--skin),
12vmin 3vmin 0 1vmin var(--skin), */
/* body option 1 */
/* 3.75vmin 19vmin 0 10vmin var(--fur), */
/* body option 2 */
3.5vmin 14vmin 0 8vmin var(--fur),
3.5vmin 16.5vmin 0 7.75vmin var(--fur),
3.5vmin 19vmin 0 7.5vmin var(--fur),
3.5vmin 21vmin 0 7.25vmin var(--fur),
3.5vmin 23vmin 0 7vmin var(--fur),
/* legs */
-13.5vmin 45.25vmin 0 0.25vmin var(--skin),
-12vmin 45.25vmin 0 0.25vmin var(--skin),
-10.5vmin 45.25vmin 0 0.25vmin var(--skin),
-8.5vmin 45vmin 0 0.5vmin var(--skin),
-11vmin 42.5vmin 0 1vmin var(--skin),
-11vmin 41vmin 0 1vmin var(--fur),
-11vmin 43vmin 0 2.25vmin var(--skin),
22.5vmin 45.25vmin 0 0.25vmin var(--skin),
21vmin 45.25vmin 0 0.25vmin var(--skin),
19.5vmin 45.25vmin 0 0.25vmin var(--skin),
17.5vmin 45vmin 0 0.5vmin var(--skin),
20vmin 42.5vmin 0 1.25vmin var(--skin),
20vmin 41vmin 0 1vmin var(--fur),
20vmin 43vmin 0 2.25vmin var(--skin),
0 calc(400vmax + 44vmin) 0 400vmax var(--ground),
4.5vmin 45vmin 0 13vmin var(--sky),
-12vmin 55vmin 0 13vmin var(--sky),
20vmin 55vmin 0 13vmin var(--sky),
4.5vmin 65vmin 0 13vmin var(--sky),
4.5vmin 45vmin 0 18vmin var(--fur),
/* top-hair */
0 -8.5vmin 0 2vmin var(--sky),
1vmin -8.5vmin 0 2vmin var(--fur),
6.75vmin -8.25vmin 0 2.5vmin var(--sky),
5.5vmin -8.25vmin 0 2.5vmin var(--fur),
/* arm-1 */
-15vmin -10vmin 0 0.75vmin var(--skin),
-15vmin -12vmin 0 0.5vmin var(--skin),
-16vmin -13vmin 0 0.5vmin var(--skin),
-17.5vmin -13.5vmin 0 0.5vmin var(--skin),
-17.5vmin -13vmin 0 0.5vmin var(--fur),
-16vmin -12.5vmin 0 0.5vmin var(--fur),
-15.25vmin -10.5vmin 0 0.75vmin var(--fur),
-17vmin -11vmin 0 1.25vmin var(--skin),
-18.5vmin -10vmin 0 1vmin var(--fur),
-17vmin -11vmin 0 2vmin var(--skin),
-7vmin -3vmin 0 11vmin var(--sky),
-5vmin -18vmin 0 15vmin var(--sky),
-7vmin -3vmin 0 15vmin var(--fur),
/* arm-2 */
26.5vmin 25.5vmin 0 1.5vmin var(--skin),
24.5vmin 25.5vmin 0 0.75vmin var(--skin),
25.5vmin 27vmin 0 0.5vmin var(--skin),
26.75vmin 27.5vmin 0 0.5vmin var(--skin),
28vmin 27vmin 0 0.5vmin var(--skin),
26.5vmin 23vmin 0 1vmin var(--fur),
26.6vmin 25.5vmin 0 2vmin var(--skin),
13vmin 22vmin 0 11vmin var(--sky),
27vmin 35vmin 0 11vmin var(--sky),
13vmin 22vmin 0 15vmin var(--fur),
/* tail */
-40vmin -15vmin 0 0.75vmin var(--fur),
-43vmin -13vmin 0 3vmin var(--sky),
-34.65vmin -6.25vmin 0 7vmin var(--sky),
-36.25vmin -4vmin 0 7vmin var(--sky),
-41.25vmin -3vmin 0 11vmin var(--sky),
-35.5vmin -5vmin 0 7vmin var(--sky),
-34vmin -8vmin 0 7.5vmin var(--sky),
-34vmin -8vmin 0 10vmin var(--fur),
-15vmin -20vmin 0 20vmin var(--sky),
-12vmin 10vmin 0 17.5vmin var(--sky),
-12vmin 10vmin 0 20vmin var(--fur),
/* sun/moon/stars */
35vmin -55vmin 0 10vmin var(--astro1),
30vmin -55vmin 0 15vmin var(--astro2),
-20vmin -60vmin 0 0.25vmin var(--star),
0vmin -90vmin 0 0.25vmin var(--star),
20vmin -120vmin 0 0.25vmin var(--star),
30vmin -100vmin 0 0.25vmin var(--star),
-30vmin -115vmin 0 0.25vmin var(--star),
-10vmin -150vmin 0 0.25vmin var(--star),
/* sky/background */
0 0 0 200vmax var(--sky);
}
Also see: Tab Triggers