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></div>
$t: transparent;
$w: #fff8f1;
$o: #DB3E2F;
$bk: #E2CD6D;
$y: yellowgreen;
$g: #D3D3D3;
$p: #FE0D82;
$teal: #47A8AE;
$bgc: #BEB9BF;
$med-gray: #ccc;
$light-gray: #eee;
$highlight-color: #1abc9c;
body{
font-size: 10px;
background: $teal;
}
div {
width: 100em;
height: 55em;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background:
// antenna
linear-gradient(
-100deg,
rgba(purple,0) 42%,
rgba(#fff,1) 43%,
rgba(#000,1) 45%,
rgba(#000,.7) 47%,
rgba(#fff,.9) 49%,
rgba($p,0) 50%)
40% 0% / 7.5em 10.45em,
// WHITE FRONT RIGHT
// BUTTONS
// right btn
// TOP
linear-gradient(45deg,
rgba(#fff,0) 10%,
rgba($teal, 0.0) 15%, rgba(#fff,0),
rgba($teal, 0) 35%, rgba(#fff,.4) 50%,
rgba($teal, 0) 65%,
rgba(#fff,0) 80%,
rgba($teal, 0.0)
)
68.8% 53.5% / 2em 1em,
linear-gradient(
rgba($teal,1) 63%,
rgba($teal,1) 63%)
68.8% 53.5% / 2em 1em,
linear-gradient(
rgba($med-gray,1) 63%,
rgba($med-gray,1) 63%)
69% 53.7% / 2em 1em,
// bottom
linear-gradient(45deg,
rgba(#fff,0) 10%,
rgba($teal, 0.0) 15%, rgba(#fff,0),
rgba($teal, 0) 35%, rgba(#fff,.4) 50%,
rgba($teal, 0) 65%,
rgba(#fff,0) 80%,
rgba($teal, 0.0)
)
68.8% 59.9% / 2em 1em,
linear-gradient(
rgba($teal,1) 63%,
rgba($teal,1) 63%)
68.8% 59.9% / 2em 1em,
linear-gradient(
rgba($med-gray,1) 63%,
rgba($med-gray,1) 63%)
69% 60.2% / 2em 1em,
// left btn
// TOP
linear-gradient(45deg,
rgba(#fff,0) 10%,
rgba($teal, 0.0) 15%, rgba(#fff,0),
rgba($teal, 0) 35%, rgba(#fff,.4) 50%,
rgba($teal, 0) 65%,
rgba(#fff,0) 80%,
rgba($teal, 0.0)
)
59% 53.5% / 2em 1em,
linear-gradient(
rgba($teal,1) 63%,
rgba($teal,1) 63%)
59% 53.5% / 2em 1em,
linear-gradient(
rgba($med-gray,1) 63%,
rgba($med-gray,1) 63%)
59.2% 53.7% / 2em 1em,
// bottom
linear-gradient(45deg,
rgba(#fff,0) 10%,
rgba($teal, 0.0) 15%, rgba(#fff,0),
rgba($teal, 0) 35%, rgba(#fff,.4) 50%,
rgba($teal, 0) 65%,
rgba(#fff,0) 80%,
rgba($teal, 0.0)
)
59% 59.9% / 2em 1em,
linear-gradient(
rgba($teal,1) 63%,
rgba($teal,1) 63%)
59% 59.9% / 2em 1em,
linear-gradient(
rgba($med-gray,1) 63%,
rgba($med-gray,1) 63%)
59.2% 60.2% / 2em 1em,
// MAIN BTN
// round
radial-gradient(
100% 100% at 50% 50%,
$t 43%,
$g 45%,
$g 50%,
$w 52%
)
64.5% 57.5% / 5.5em 5.5em,
linear-gradient(45deg,
rgba(#fff,0) 10%,
rgba($teal, 0.0) 15%, rgba(#fff,0),
rgba($teal, 0) 35%, rgba(#fff,.55) 50%,
rgba($teal, 0) 65%,
rgba(#fff,0) 80%,
rgba($teal, 0.0)
)
64.5% 57.5% / 5em 5em,
radial-gradient(
100% 100% at 50% 50%,
$t 47%,
#fff 48%,
$w 48%
)
64.5% 57.5% / 5.2em 5.2em,
-webkit-radial-gradient(0% 50%, 50% 15%, rgba(0,0,0,.4) 0%, hsla(0,0%,100%,0) 100%) 64.5% 57.5% / 5em 5em,
-webkit-radial-gradient( 100% 50%, 50% 15%, rgba(0,0,0,.4) 0%, hsla(0,0%,100%,0) 100%) 64.5% 57.5% / 5em 5em,
-webkit-repeating-radial-gradient( 50% 50%, 100% 100%, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 5%, hsla(0,0%,100%,.1) 7.5%) 64.5% 57.5% / 5em 5em,
-webkit-repeating-radial-gradient( 50% 50%, 100% 100%, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 1.2%, hsla(0,0%,100%,.2) 2%) 64.5% 57.5% / 5em 5em,
-webkit-radial-gradient(50% 50%, 100% 100%, hsla(0,0%,100%,.1), hsla(0,0%,85%,1) 30%, hsla(0,0%,60%,1) 50%, rgba($w,1)51%) 64.5% 57.5% / 5em 5em,
radial-gradient(
100% 100% at 50% 50%,
$bgc .45em,
$med-gray 50%,
$t 51%
)
64.5% 57.5% / 5em 5em,
// BLACK SCREEN GLASS
linear-gradient(45deg,
rgba(#fff,0) 10%, rgba($teal, 0.0) 15%, rgba(#fff,0), rgba($teal, 0) 35%, rgba(#fff,.13) 55%,
rgba($teal, 0) 75%, rgba(#fff,0) 80%, rgba($teal, 0.0)
) 57em 19em / 13em 8em,
// INNER BLACK SCREEN
// green light
radial-gradient(
100% 100% at 50% 50%,
yellowgreen 48%,
rgba(#fff,.3) 52%
)
67.5% 46.35% / .8em .8em,
// red
linear-gradient(
rgba(red,.8) 63%,
rgba(red,.8) 63%)
59.6em 39.9% / 1em .25em,
// rounded corners
// TR
radial-gradient(
80% 80% at 0% 100%,
#232323 1.45em,
#232323 50%,
#000 51%
)
67.7em 19.8em / 1.5em 1.5em,
// TL
radial-gradient(
80% 80% at 100% 100%,
#232323 1.45em,
#232323 50%,
#000 51%
)
57.9em 19.8em / 1.5em 1.5em,
// BL
radial-gradient(
80% 80% at 100% 0%,
#232323 1.45em,
#232323 50%,
#000 51%
)
57.8em 22.85em / 1.5em 1.5em,
// BR
radial-gradient(
80% 80% at 0% 0%,
#232323 1.45em,
#232323 50%,
#000 51%
)
67.7em 22.85em / 1.5em 1.5em,
linear-gradient(
rgba(#232323,1) 63%,
rgba(#232323,1) 63%)
58em 20em / 11em 4em,
// BLACK SCREEN
// rounded corners
// TR
radial-gradient(
190% 190% at 0% 100%,
#000 46%,
$w 51%
)
68.6em 18.88em / 1.5em 1.5em,
// TL
radial-gradient(
190% 190% at 100% 100%,
#000 46%,
$w 51%
)
57.8% 18.88em / 1.5em 1.5em,
// BL
radial-gradient(
190% 190% at 100% 0%,
#000 46%,
$w 51%
)
57.8% 25.6em / 1.5em 1.5em,
// BR
radial-gradient(
190% 190% at 0% 0%,
#000 46%,
$w 51%
)
68.6em 25.6em / 1.5em 1.5em,
linear-gradient(
rgba(#000,1) 63%,
rgba(#000,1) 63%)
57em 19em / 13em 8em,
// rounded corners
// TR
radial-gradient(
190% 190% at 0% 100%,
#fff 1.45em,
#fff 50%,
$w 51%
)
45em 18.5em / 2.5em 2.5em,
// TL
radial-gradient(
190% 190% at 100% 100%,
#fff 1.45em,
#fff 50%,
$w 51%
)
29em 18.5em / 2.5em 2.5em,
// BR
radial-gradient(
190% 190% at 100% 0%,
#fff 1.45em,
#fff 50%,
$w 51%
)
29em 34.1em / 2.5em 2.5em,
// BL
radial-gradient(
190% 190% at 0% 0%,
#fff 1.45em,
#fff 50%,
$w 51%
)
45em 34.1em / 2.5em 2.5em,
linear-gradient(
#fff 63%,
#fff 63%)
29em 50% / 18.5em 18em,
// WHITE BACK
// rounded corners
// TR
radial-gradient(
190% 190% at 0% 100%,
$w 1.45em,
$w 50%,
$o 51%
)
71.2em 14.85em / 4em 4em,
// TL
radial-gradient(
190% 190% at 100% 100%,
$w 1.45em,
$w 50%,
$o 51%
)
24.88em 14.85em / 4em 4em,
// BR
radial-gradient(
190% 190% at 100% 0%,
$w 1.45em,
$w 50%,
$o 51%
)
24.88em 36.2em / 4em 4em,
// BL
radial-gradient(
190% 190% at 0% 0%,
$w 1.45em,
$w 50%,
$o 51%
)
71.2em 36.2em / 4em 4em,
linear-gradient(
$w 63%,
$w 63%)
50% 15em / 50em 25em,
// TOP
// WHITE PART
// TOP PART & HANDLE
linear-gradient(
-120deg,
rgba($bk,1) 63%,
rgba($t,0) 63%)
76% 19% / 5em 3em,
linear-gradient(
120deg,
rgba($bk,1) 63%,
rgba($t,0) 63%)
23.9% 19% / 5em 3em,
linear-gradient(
to bottom,
$o,
rgba(#232323,.5),
rgba(#fff,.4),
$o )
50% 19.9% / 51em 2.3em,
linear-gradient(
$o 63%,
$o 63%)
50% 19.9% / 51em 2.3em,
// ORANGE BACK
// rounded corners
// TR
radial-gradient(
180% 180% at 0% 100%,
$o 1.45em,
$o 50%,
$bk 51%
)
76.96% 24.2% / 4em 4em,
// TL
radial-gradient(
180% 180% at 100% 100%,
$o 1.45em,
$o 50%,
$bk 51%
)
23% 24.2% / 4em 4em,
// BL
radial-gradient(
180% 180% at 100% 0%,
$o 1.45em,
$o 50%,
$bk 51%
)
23% 76.2% / 4em 4em,
// BR
radial-gradient(
180% 180% at 0% 0%,
$o 1.45em,
$o 50%,
$bk 51%
)
76.96% 76.2% / 4em 4em,
// SHADOW
linear-gradient(
to top,
rgba(#000, .1),
$o 63%)
50% 40em / 46em 2.5em,
linear-gradient(
$o 63%,
$o 63%)
50% 50% / 55em 30em,
// side metal tabs
// left
linear-gradient(
to bottom,
rgba(#000,.8) 20%,
rgba(#fff,1) 25%,
rgba(#000,1) 63%,
rgba(#fff,1) 73%,
rgba(#000,.3) 80%
)
78.2% 36% / 1em 2em,
linear-gradient(
rgba($g,1) 63%,
rgba($g,1) 63%)
78.2% 36% / 1em 2em,
// right
linear-gradient(
to bottom,
rgba(#000,.8) 20%,
rgba(#fff,1) 25%,
rgba(#000,1) 63%,
rgba(#fff,1) 73%,
rgba(#000,.3) 80%
)
21.6% 36% / 1em 2em,
linear-gradient(
rgba($g,1) 63%,
rgba($g,1) 63%)
21.6% 36% / 1em 2em,
// feet
// left
radial-gradient(
100% 50% at 50% 50%,
$w ,
$g 10%,
$w 60%,
$t 51%
)
32em 81% / 2.8em 10em,
// right
radial-gradient(
100% 50% at 50% 50%,
$w ,
$g 10%,
$w 60%,
$t 51%
)
64em 81% / 2.8em 10em,
linear-gradient(
$bk, $bk
)
;
background-repeat: no-repeat;
&:after{
content: '';
width: 15em;
height: 16em;
position: absolute;
background: #fff;
background:
radial-gradient(gray 50%, transparent 0),
radial-gradient(#585858 50%, transparent 0);
background-size: .3em .3em;
top: 35.5%;
left: 30.85%;
}
&:before{
content: '';
width: 15em;
height: 16em;
position: absolute;
top: 35.5%;
left: 30.85%;
background:
// gray part
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 0% / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% .8em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% .8em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% .8em / 85% .8em,
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 1.6em / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 2.4em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 2.4em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 2.4em / 85% .8em,
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 3.2em / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 4em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 4em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 4em / 85% .8em,
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 4.8em / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 5.6em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 5.6em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 5.6em / 85% .8em,
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 6.4em / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 7.2em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 7.2em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 7.2em / 85% .8em,
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 8em / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 8.8em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 8.8em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 8.8em / 85% .8em,
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 9.6em / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 10.4em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 10.4em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 10.4em / 85% .8em,
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 11.2em / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 12em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 12em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 12em / 85% .8em,
// ////////////////
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 12.8em / 100% .8em,
// // L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 13.6em / .8em .8em,
// // R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 13.6em / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 13.6em / 85% .8em,
// ////////////////
// BOTTOM
// BLOCKER
linear-gradient(
#fff 63%,
#fff 63%)
50% 14.4em / 100% .8em,
// L
radial-gradient(
50% 50% at 100% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
0% 100% / .8em .8em,
// R
radial-gradient(
50% 50% at 00% 50%,
$t 1.45em,
$t 50%,
#fff 51%
)
100% 100% / .8em .8em,
linear-gradient(
$t 63%,
$t 63%)
50% 100% / 95% .8em,
////////////////
linear-gradient(
rgba(gray,.2),
rgba(gray,.2))
;
background-repeat: no-repeat;
z-index: 2;
}
}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (max-width: 600px) {
body {
font-size: 5px;
};
}
Also see: Tab Triggers