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="meal">
<div class="burger"></div>
<div class="fries"></div>
<div class="shake"></div>
</div>
<div class="about">
<h1 class="title">box-shadow pixel art</h1>
<p class="description">In memory of Burger Man and Fry Guy from r/place. Covered by the Void in the end.</p>
</div>
$black: #161616;
$white: #fff;
$brown: #a16331;
$tan: #d89042;
$red: #e30000;
$orange: #f76900;
$yellow: #fab100;
$sky: #48caea;
$blue: #0071c0;
$green: #079200;
$lime: #68c259;
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
body {
background-color: #d4e8f9;
font-size: 100%;
}
.meal {
font-size: 0.375em;
height: 23em;
margin: auto;
position: relative;
width: 43em;
@media only screen and (min-width: 400px) {
font-size: 0.5em;
}
@media only screen and (min-width: 600px) {
font-size: 0.75em;
}
@media only screen and (min-width: 800px) {
font-size: 1em;
}
@media only screen and (min-width: 1000px) {
font-size: 1.25em;
}
@media only screen and (min-width: 1200px) {
font-size: 1.375em;
}
@media only screen and (min-width: 1400px) {
font-size: 1.625em;
}
}
.burger {
height:14em;
left: 0;
position: absolute;
top: 7em;
width: 18em;
&::after {
background-color: $black;
content: '';
height: 1em;
left: 0;
position: absolute;
top: 5em;
width: 1em;
box-shadow: 4em -5em 0 $black,
5em -5em 0 $black,
6em -5em 0 $black,
7em -5em 0 $black,
8em -5em 0 $black,
9em -5em 0 $black,
10em -5em 0 $black,
11em -5em 0 $black,
12em -5em 0 $black,
13em -5em 0 $black,
// Bun 2
3em -4em 0 $black,
4em -4em 0 $tan,
5em -4em 0 $tan,
6em -4em 0 $tan,
7em -4em 0 $tan,
8em -4em 0 $tan,
9em -4em 0 $tan,
10em -4em 0 $tan,
11em -4em 0 $tan,
12em -4em 0 $tan,
13em -4em 0 $tan,
14em -4em 0 $black,
// Bun 3
2em -3em 0 $black,
3em -3em 0 $tan,
4em -3em 0 $tan,
5em -3em 0 $tan,
6em -3em 0 $white,
7em -3em 0 $white,
8em -3em 0 $tan,
9em -3em 0 $tan,
10em -3em 0 $white,
11em -3em 0 $white,
12em -3em 0 $tan,
13em -3em 0 $tan,
14em -3em 0 $tan,
15em -3em 0 $black,
// Bun 4
1em -2em 0 $black,
2em -2em 0 $tan,
3em -2em 0 $tan,
4em -2em 0 $tan,
5em -2em 0 $tan,
6em -2em 0 $white,
7em -2em 0 $black,
8em -2em 0 $tan,
9em -2em 0 $tan,
10em -2em 0 $white,
11em -2em 0 $black,
12em -2em 0 $tan,
13em -2em 0 $tan,
14em -2em 0 $tan,
15em -2em 0 $tan,
16em -2em 0 $black,
// Bun 5
1em -1em 0 $black,
2em -1em 0 $tan,
3em -1em 0 $tan,
4em -1em 0 $tan,
5em -1em 0 $tan,
6em -1em 0 $tan,
7em -1em 0 $tan,
8em -1em 0 $tan,
9em -1em 0 $tan,
10em -1em 0 $tan,
11em -1em 0 $tan,
12em -1em 0 $tan,
13em -1em 0 $tan,
14em -1em 0 $tan,
15em -1em 0 $tan,
16em -1em 0 $black,
// Patty 1
1em 0 0 $black,
2em 0 0 $black,
3em 0 0 $black,
4em 0 0 $black,
5em 0 0 $black,
6em 0 0 $black,
7em 0 0 $black,
8em 0 0 $black,
9em 0 0 $black,
10em 0 0 $black,
11em 0 0 $black,
12em 0 0 $black,
13em 0 0 $black,
14em 0 0 $black,
15em 0 0 $black,
16em 0 0 $black,
17em 0 0 $black,
// Patty 2
0 1em 0 $black,
1em 1em 0 $brown,
2em 1em 0 $brown,
3em 1em 0 $brown,
4em 1em 0 $brown,
5em 1em 0 $brown,
6em 1em 0 $brown,
7em 1em 0 $brown,
8em 1em 0 $brown,
9em 1em 0 $brown,
10em 1em 0 $brown,
11em 1em 0 $brown,
12em 1em 0 $brown,
13em 1em 0 $brown,
14em 1em 0 $brown,
15em 1em 0 $brown,
16em 1em 0 $brown,
17em 1em 0 $black,
// Patty 3
0 2em 0 $black,
1em 2em 0 $black,
2em 2em 0 $black,
3em 2em 0 $black,
4em 2em 0 $black,
5em 2em 0 $black,
6em 2em 0 $black,
7em 2em 0 $black,
8em 2em 0 $black,
9em 2em 0 $black,
10em 2em 0 $black,
11em 2em 0 $black,
12em 2em 0 $black,
13em 2em 0 $black,
14em 2em 0 $black,
15em 2em 0 $black,
16em 2em 0 $black,
17em 2em 0 $black,
// Cheese
0 3em 0 $black,
1em 3em 0 $yellow,
2em 3em 0 $yellow,
3em 3em 0 $yellow,
4em 3em 0 $yellow,
5em 3em 0 $yellow,
6em 3em 0 $yellow,
7em 3em 0 $yellow,
8em 3em 0 $yellow,
9em 3em 0 $yellow,
10em 3em 0 $yellow,
11em 3em 0 $yellow,
12em 3em 0 $yellow,
13em 3em 0 $yellow,
14em 3em 0 $yellow,
15em 3em 0 $yellow,
16em 3em 0 $yellow,
17em 3em 0 $black,
// Lettuce 1
1em 4em 0 $black,
2em 4em 0 $green,
3em 4em 0 $green,
4em 4em 0 $lime,
5em 4em 0 $lime,
6em 4em 0 $yellow,
7em 4em 0 $yellow,
8em 4em 0 $green,
9em 4em 0 $lime,
10em 4em 0 $lime,
11em 4em 0 $lime,
12em 4em 0 $green,
13em 4em 0 $green,
14em 4em 0 $lime,
15em 4em 0 $lime,
16em 4em 0 $black,
// Lettuce 2
1em 5em 0 $black,
2em 5em 0 $black,
3em 5em 0 $black,
4em 5em 0 $green,
5em 5em 0 $green,
6em 5em 0 $green,
7em 5em 0 $black,
8em 5em 0 $black,
9em 5em 0 $green,
10em 5em 0 $green,
11em 5em 0 $green,
12em 5em 0 $black,
13em 5em 0 $black,
14em 5em 0 $green,
15em 5em 0 $green,
16em 5em 0 $black,
// Bottom Bun 1
1em 6em 0 $black,
2em 6em 0 $tan,
3em 6em 0 $tan,
4em 6em 0 $black,
5em 6em 0 $black,
6em 6em 0 $black,
7em 6em 0 $tan,
8em 6em 0 $tan,
9em 6em 0 $black,
10em 6em 0 $black,
11em 6em 0 $black,
12em 6em 0 $tan,
13em 6em 0 $tan,
14em 6em 0 $black,
15em 6em 0 $black,
16em 6em 0 $black,
// Bottom Bun 2
1em 7em 0 $black,
2em 7em 0 $tan,
3em 7em 0 $tan,
4em 7em 0 $tan,
5em 7em 0 $tan,
6em 7em 0 $tan,
7em 7em 0 $tan,
8em 7em 0 $tan,
9em 7em 0 $tan,
10em 7em 0 $tan,
11em 7em 0 $tan,
12em 7em 0 $tan,
13em 7em 0 $tan,
14em 7em 0 $tan,
15em 7em 0 $tan,
16em 7em 0 $black,
// Bottom
2em 8em 0 $black,
3em 8em 0 $black,
4em 8em 0 $black,
5em 8em 0 $black,
6em 8em 0 $black,
7em 8em 0 $black,
8em 8em 0 $black,
9em 8em 0 $black,
10em 8em 0 $black,
11em 8em 0 $black,
12em 8em 0 $black,
13em 8em 0 $black,
14em 8em 0 $black,
15em 8em 0 $black;
}
}
.fries {
height:15em;
left: 19em;
position: absolute;
top: 6em;
width: 11em;
&::after {
background-color: $black;
content: '';
height: 1em;
left: 4em;
position: absolute;
top: 0;
width: 1em;
box-shadow: 1em 0 0 $black,
// row 2
-2em 1em 0 $black,
-1em 1em 0 $black,
0 1em 0 $yellow,
1em 1em 0 $orange,
2em 1em 0 $black,
// row 3
-3em 2em 0 $black,
-2em 2em 0 $yellow,
-1em 2em 0 $orange,
0 2em 0 $yellow,
1em 2em 0 $orange,
2em 2em 0 $black,
3em 2em 0 $black,
// row 4
-3em 3em 0 $black,
-2em 3em 0 $yellow,
-1em 3em 0 $orange,
0 3em 0 $yellow,
1em 3em 0 $orange,
2em 3em 0 $yellow,
3em 3em 0 $orange,
4em 3em 0 $black,
// row 5
-3em 4em 0 $black,
-2em 4em 0 $yellow,
-1em 4em 0 $orange,
0 4em 0 $yellow,
1em 4em 0 $orange,
2em 4em 0 $yellow,
3em 4em 0 $orange,
4em 4em 0 $black,
// row 6
-3em 5em 0 $black,
-2em 5em 0 $yellow,
-1em 5em 0 $orange,
0 5em 0 $yellow,
1em 5em 0 $orange,
2em 5em 0 $yellow,
3em 5em 0 $orange,
4em 5em 0 $black,
// row 7
-4em 6em 0 $black,
-3em 6em 0 $black,
-2em 6em 0 $black,
-1em 6em 0 $black,
0 6em 0 $black,
1em 6em 0 $black,
2em 6em 0 $black,
3em 6em 0 $black,
4em 6em 0 $black,
5em 6em 0 $black,
6em 6em 0 $black,
// row 8
-4em 7em 0 $black,
-3em 7em 0 $red,
-2em 7em 0 $red,
-1em 7em 0 $red,
0 7em 0 $red,
1em 7em 0 $red,
2em 7em 0 $red,
3em 7em 0 $red,
4em 7em 0 $red,
5em 7em 0 $red,
6em 7em 0 $black,
// row 9
-4em 8em 0 $black,
-3em 8em 0 $red,
-2em 8em 0 $red,
-1em 8em 0 $black,
0 8em 0 $white,
1em 8em 0 $red,
2em 8em 0 $black,
3em 8em 0 $white,
4em 8em 0 $red,
5em 8em 0 $red,
6em 8em 0 $black,
// row 10
-4em 9em 0 $black,
-3em 9em 0 $red,
-2em 9em 0 $red,
-1em 9em 0 $white,
0 9em 0 $white,
1em 9em 0 $red,
2em 9em 0 $white,
3em 9em 0 $white,
4em 9em 0 $red,
5em 9em 0 $red,
6em 9em 0 $black,
// row 11
-4em 10em 0 $black,
-3em 10em 0 $red,
-2em 10em 0 $red,
-1em 10em 0 $red,
0 10em 0 $red,
1em 10em 0 $red,
2em 10em 0 $red,
3em 10em 0 $red,
4em 10em 0 $red,
5em 10em 0 $red,
6em 10em 0 $black,
// row 12
-3em 11em 0 $black,
-2em 11em 0 $red,
-1em 11em 0 $black,
0 11em 0 $red,
1em 11em 0 $red,
2em 11em 0 $red,
3em 11em 0 $black,
4em 11em 0 $red,
5em 11em 0 $black,
// row 13
-3em 12em 0 $black,
-2em 12em 0 $red,
-1em 12em 0 $red,
0 12em 0 $black,
1em 12em 0 $black,
2em 12em 0 $black,
3em 12em 0 $red,
4em 12em 0 $red,
5em 12em 0 $black,
// row 14
-3em 13em 0 $black,
-2em 13em 0 $red,
-1em 13em 0 $red,
0 13em 0 $red,
1em 13em 0 $red,
2em 13em 0 $red,
3em 13em 0 $red,
4em 13em 0 $red,
5em 13em 0 $black,
// row 15
-3em 14em 0 $black,
-2em 14em 0 $black,
-1em 14em 0 $black,
0 14em 0 $black,
1em 14em 0 $black,
2em 14em 0 $black,
3em 14em 0 $black,
4em 14em 0 $black,
5em 14em 0 $black;
}
}
.shake {
height:19em;
left: 30em;
position: absolute;
top: 2em;
width: 13em;
&::after {
background-color: $black;
content: '';
height: 1em;
left: 0;
position: absolute;
top: 3em;
width: 1em;
box-shadow: 1em 0 0 $black,
2em 0 0 $black,
3em 0 0 $black,
4em 0 0 $black,
5em 0 0 $black,
6em 0 0 $black,
7em 0 0 $black,
8em 0 0 $black,
9em 0 0 $black,
10em 0 0 $black,
11em 0 0 $black,
12em 0 0 $black,
// straw
5em -1em 0 $sky,
5em -2em 0 $sky,
5em -3em 0 $sky,
6em -1em 0 $blue,
6em -2em 0 $blue,
6em -3em 0 $blue,
// row 2
0 1em 0 $black,
1em 1em 0 $white,
2em 1em 0 $white,
3em 1em 0 $white,
4em 1em 0 $white,
5em 1em 0 $white,
6em 1em 0 $white,
7em 1em 0 $white,
8em 1em 0 $white,
9em 1em 0 $white,
10em 1em 0 $white,
11em 1em 0 $white,
12em 1em 0 $black,
// row 3
1em 2em 0 $black,
2em 2em 0 $black,
3em 2em 0 $black,
4em 2em 0 $black,
5em 2em 0 $black,
6em 2em 0 $black,
7em 2em 0 $black,
8em 2em 0 $black,
9em 2em 0 $black,
10em 2em 0 $black,
11em 2em 0 $black,
// row 4
1em 3em 0 $black,
2em 3em 0 $sky,
3em 3em 0 $sky,
4em 3em 0 $sky,
5em 3em 0 $sky,
6em 3em 0 $sky,
7em 3em 0 $sky,
8em 3em 0 $sky,
9em 3em 0 $sky,
10em 3em 0 $blue,
11em 3em 0 $black,
// row 5
1em 4em 0 $black,
2em 4em 0 $sky,
3em 4em 0 $white,
4em 4em 0 $white,
5em 4em 0 $sky,
6em 4em 0 $white,
7em 4em 0 $white,
8em 4em 0 $sky,
9em 4em 0 $sky,
10em 4em 0 $blue,
11em 4em 0 $black,
// row 6
1em 5em 0 $black,
2em 5em 0 $sky,
3em 5em 0 $black,
4em 5em 0 $white,
5em 5em 0 $sky,
6em 5em 0 $black,
7em 5em 0 $white,
8em 5em 0 $sky,
9em 5em 0 $sky,
10em 5em 0 $blue,
11em 5em 0 $black,
// row 7
1em 6em 0 $black,
2em 6em 0 $sky,
3em 6em 0 $sky,
4em 6em 0 $sky,
5em 6em 0 $sky,
6em 6em 0 $sky,
7em 6em 0 $sky,
8em 6em 0 $sky,
9em 6em 0 $sky,
10em 6em 0 $blue,
11em 6em 0 $black,
// row 8
2em 7em 0 $black,
3em 7em 0 $sky,
4em 7em 0 $sky,
5em 7em 0 $sky,
6em 7em 0 $sky,
7em 7em 0 $black,
8em 7em 0 $sky,
9em 7em 0 $blue,
10em 7em 0 $black,
// row 9
2em 8em 0 $black,
3em 8em 0 $sky,
4em 8em 0 $black,
5em 8em 0 $black,
6em 8em 0 $black,
7em 8em 0 $sky,
8em 8em 0 $sky,
9em 8em 0 $blue,
10em 8em 0 $black,
// row 10
2em 9em 0 $black,
3em 9em 0 $sky,
4em 9em 0 $sky,
5em 9em 0 $sky,
6em 9em 0 $sky,
7em 9em 0 $sky,
8em 9em 0 $sky,
9em 9em 0 $blue,
10em 9em 0 $black,
// row 11
2em 10em 0 $black,
3em 10em 0 $sky,
4em 10em 0 $sky,
5em 10em 0 $sky,
6em 10em 0 $sky,
7em 10em 0 $sky,
8em 10em 0 $sky,
9em 10em 0 $blue,
10em 10em 0 $black,
// row 12
2em 11em 0 $black,
3em 11em 0 $sky,
4em 11em 0 $sky,
5em 11em 0 $sky,
6em 11em 0 $sky,
7em 11em 0 $sky,
8em 11em 0 $sky,
9em 11em 0 $blue,
10em 11em 0 $black,
// row 13
3em 12em 0 $black,
4em 12em 0 $sky,
5em 12em 0 $sky,
6em 12em 0 $sky,
7em 12em 0 $sky,
8em 12em 0 $blue,
9em 12em 0 $black,
// row 14
3em 13em 0 $black,
4em 13em 0 $sky,
5em 13em 0 $sky,
6em 13em 0 $sky,
7em 13em 0 $sky,
8em 13em 0 $blue,
9em 13em 0 $black,
// row 15
3em 14em 0 $black,
4em 14em 0 $sky,
5em 14em 0 $sky,
6em 14em 0 $sky,
7em 14em 0 $sky,
8em 14em 0 $blue,
9em 14em 0 $black,
// row 16
3em 15em 0 $black,
4em 15em 0 $black,
5em 15em 0 $black,
6em 15em 0 $black,
7em 15em 0 $black,
8em 15em 0 $black,
9em 15em 0 $black;
}
}
.about {
line-height: 1.5;
margin: 2em auto 4em auto;
max-width: 28em;
padding: 0 1em;
}
.title {
color: $black;
font-family: monospace;
font-size: 1.5em;
font-weight: normal;
margin: 2em auto 0.5em auto;
@media only screen and (min-width: 1000px) {
font-size: 2em;
}
}
.description {
color: $black;
font-family: monospace;
font-size: 1em;
font-weight: normal;
}
Also see: Tab Triggers