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 role="img" aria-label="stapler"></div>
$t: transparent;
$bk: #fff;
// $bk:red;
$p: #FA057E;
@mixin for-phone-only {
@media (max-width: 599px) {
@content;
}
}
body{
overflow: hidden;
font-size: 1.5vmin;
background-color: $bk;
}
div {
width: 100em;
height: 55em;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background:
// VERY TOP PART
linear-gradient(
-4.5deg,
rgba($p,.0) 40%, rgba($bk,1) 41%,
)
54% 0% / 65em 19em,
// left front angle line
linear-gradient(
45deg,
rgba($bk,1) 50%, rgba($t,0) 51%,
)
17.8% 28.5% / 10em 5em,
// top white shadow
linear-gradient(
-4deg,
rgba($p,.0) 40%, rgba(#fff,.3), rgba($t,0) 47%,
)
54% 26.5% / 65em 7em,
// bottom white shadow
linear-gradient(
-5deg,
rgba($p,.0) 40%, rgba(#fff,.4), rgba($t,0) 47%,
)
63% 45.5% / 55em 7em,
// FRONT SQUARE LEFT BLOCK
linear-gradient(
-85deg,
rgba($t,0) 55%, rgba($bk,1) 56%,
// $t 60%
)
15% 32% / 10em 10em,
// FRONT SQUARE BOTTOM BLOCK
linear-gradient(
45deg,
rgba($bk,1) 55%, rgba($t,.0) 56%,
// $t 60%
)
15% 47.4% / 10em 10em,
// FRONT SQUARE SHADOW
// SHADOW
linear-gradient(
-85deg,
rgba($p,.0) 30%, rgba(#FCADA4,1) ,
rgba(#000,.0) 60%
)
20% 42.5% / 10em 9.5em,
// FRONT SQUARE
linear-gradient(
-84deg,
rgba($p,.0) 41%, rgba(#FBC6BE,1) 32%,
// $t 60%
)
17% 36% / 14em 15em,
// right back angle line
linear-gradient(
38deg,
rgba($t,.0) 50%, rgba($bk,1) 51%,
)
84% 20% / 10em 8.5em,
// top white shadow
linear-gradient(
-4.5deg,
rgba($p,.0) 38.5%, rgba(#F9C7C1,.1), rgba($t,0) 40%,
)
54% 0% / 65em 19em,
// btm blocker
linear-gradient(
-4deg,
rgba($p,.0) 40%, rgba(#fff,.1) 41%,
)
54% 14.1% / 65em 20em,
linear-gradient(
-4deg,
rgba($p,.0) 40%, rgba(#FFECE8,1) 41%,
)
54% 14.1% / 65em 20em,
// END VERY TOP PART
linear-gradient(
-4deg,
rgba($t,0) 49%, rgba($bk,1) 50%,
)
57% 15% / 59em 25em,
linear-gradient(
-84deg,
rgba($bk,1) 50%, rgba($t,0) 52%,
)
84% 33.5% / 6em 9.5em,
// DARK FRONT TOP MIDDLE PART
// BLOCKER CORNER
radial-gradient(
170% 100% at 50% 0%,
$t 50%,
$bk 51%
)
22.3% 53% / 2.3em 2em,
// BLOCKER LEFT
linear-gradient(
45deg,
rgba($bk,1) 50%, rgba($t,.0) 52%
)
17% 47% / 7.5em 7em,
// BLOCKER
linear-gradient(
-4.8deg,
rgba($bk,1) 50%, rgba($t,0) 52%
)
25.3% 52.4% / 15em 5em,
// SHADOW
linear-gradient(
-85deg,
rgba($p,.0) 35%, rgba(#FCADA4,1) 52%,
$t 60%
)
20% 40% / 10em 13em,
linear-gradient(
-4.8deg,
rgba($p,.0) 48%, rgba(#fff,.3), rgba(#FDCBC4,1) 53%,
#FDCBC2
)
57% 48% / 59em 5em,
linear-gradient(
-4.8deg,
rgba($p,.0) 50%, rgba(#FDCBC4,1) 52%,
#FDCBC2
)
57% 48% / 59em 25em,
// shadow btm middle right
linear-gradient(
-11.5deg,
rgba($p,.0) 43%,
rgba(#FE9D8F,1) 52%,
$t 58%,
)
76.8% 56% / 18.5em 5em,
// TOP METAL
// TOP METAL FRONT
linear-gradient(
45deg,
rgba(red,.0) 44%,
#E8E7ED 46%
)
21.9% 57.8% / 4.2em 7em,
// TOP METAL MAIN
linear-gradient(
-10.3deg,
rgba($t,.0) 44%, rgba($t,.4) 45%,#E8E7ED 46%
)
39% 55% / 35.5em 10em,
// END TOP METAL
// BTM PART MDL
linear-gradient(
-11deg,
rgba($bk,1) 39%, rgba($t,0) 40%,
)
76.8% 51.5% / 18.5em 20em,
// MIDDLE PART
// shadow top middle
linear-gradient(
-4.8deg,
rgba($p,.0) 55%, rgba(#FFC1B6,1) 61%,
#FDCBC2
)
76.8% 47% / 25em 3em,
// pink middle
linear-gradient(
-4.8deg,
rgba($t,.0) 40%, rgba(#FEC2B7,1) 41%,
#FDCBC2
)
76.8% 58% / 18.5em 14em,
linear-gradient(
38deg,
rgba(green,.0) 44%,
rgba(#fff,.7) 46%,
rgba($t,0) 49%
)
59.5% 48% / 5.5em 5em,
linear-gradient(
38deg,
rgba(#DD453D,0) 55%,
rgba(#B42F2A,1) 56%
)
60% 50% / 5em 8.6em,
linear-gradient(
45deg,
rgba(#B42F2A,0) 44%,
rgba(#FFCEC5,.3) 46%,
rgba(#FFCEC5,.7) 76%
)
60.6% 54% / 5em 8.6em,
linear-gradient(
45deg,
rgba(#B42F2A,0) 44%,
rgba(#D2453C,1) 46%
)
60.6% 54% / 5em 8.6em,
// MIDDLE MIDDLE
// shadow
linear-gradient(
-12deg,
rgba(red,1)19%,
rgba(#FEC1B6,1),
rgba(#E0867E,1),
rgba(#E3928A,1),
rgba(#FEC1B6,1) 41%,
rgba($t,0) 42%,
)
32% 50% / 45em 29em,
// main
linear-gradient(
-12deg,
rgba(#FEC1B6,1) 41%, rgba($t,0) 42%,
)
32% 50% / 45em 29em,
;
background-repeat: no-repeat;
&:after{
content: '';
width: 100em;
height: 55em;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background:
// BTM
// shadow
linear-gradient(
45deg,
rgba($p,.0) 46%,
rgba($t,.3),
rgba($t,.8) 52%,
rgba(blue,.0) 55%,
)
16.8% 81.5% / 10em 5.7em,
linear-gradient(
-11.3deg,
rgba($p,.0) 36%,
rgba($t,.3),
rgba($t,.8) 38%,
rgba($t,.0) 39%,
)
55.3% 76% / 58.7em 25em,
linear-gradient(
-11.3deg,
rgba($t,.0) 49%,
rgba($bk,1) 50%,
rgba($bk,1) 63%,
rgba(blue,.0) 63.5%
)
19.3% 64.4% / 7em 6em,
linear-gradient(
45deg,
rgba($t,.0) 49%,
rgba(#E1E0E1,1) 50%,
rgba($t,.4) 51%,
rgba($t,.2) 51%,
rgba(blue,.0) 52.5%
)
22% 69% / 15em 5.5em,
linear-gradient(
45deg,
rgba($t,.0) 49%,
rgba($t,.2) 50%,
rgba($t,.1) 51%,
rgba(#E1E0E1,1) 51.5%,
rgba(blue,.0) 63.5%
)
18.5% 69% / 15em 6em,
linear-gradient(
45deg,
rgba($t,.0) 49%,
rgba($t,.4) 50%,
rgba($t,.2) 51%,
rgba(#E1E0E1,1) 51.5%,
rgba(blue,.0) 63.5%
)
18.5% 69% / 15em 6em,
linear-gradient(
45deg,
rgba($t,.0) 49%,
rgba(#E1E0E1,1) 50%,
rgba(#E1E0E1,1) 63%,
rgba(blue,.0) 63.5%
)
18.5% 69% / 15em 6em,
// LEFT BTM FRONT Shadow
linear-gradient(
to right,
rgba($t,.0) 30%,
rgba(#FCAD9E,.4) 40%,
rgba(#FCAD9E,.6) 62%,
rgba(red,.0) 90%
)
22.5% 80% / 2em 4em,
// LEFT BTM FRONT
linear-gradient(
45deg,
rgba($t,.0) 39.5%,
rgba(#F1B2A9,1) 40%,
rgba(#FFC2B7,1) 62%,
rgba($t,.0) 63%
)
18.5% 81% / 5.5em 12.5em,
// MIDDLE END BLOCKER
linear-gradient(
45deg,
rgba(#fff,1) 46%,
rgba(#fff,.5) 48%,
rgba($t,.0) 55%
)
18% 74% / 6em 12em,
linear-gradient(
rgba($bk,1) 54%,
rgba($bk,1) 55%
)
18% 89% / 6em 9em,
// BTM
// shadow
linear-gradient(
-11.3deg,
rgba(blue,.0) 30%,
rgba(#fff,.8) 31%,
rgba($t,.0) 32%,
)
50% 53% / 63em 25em,
// blocker
linear-gradient(
-11.3deg,
rgba($bk,1) 50%,
rgba($t,0) 51%,
)
50% 81.4% / 65em 15em,
linear-gradient(
-11.3deg,
rgba(blue,0) 30%,
#FFC2B7 31%,
#FFC2B7 44.5%,
rgba($t,.0) 45%,
)
50% 70% / 63em 25em,
// END BTM
// TOP METAL middle dark line
linear-gradient(
-4.8deg,
rgba($p,.0) 48%, rgba(#fff,.3), rgba(#FDCBC4,1) 53%,
#FDCBC2
)
57% 48% / 55em 5em,
// LEFT LG LINES
// SHADOW P
linear-gradient(
-10.3deg,
rgba(red,.0) 45%,
rgba(#B21B13,.7),
rgba(#B21B13,.3),
rgba(blue,.0) 52%,
)
33% 51% / 15em 3em,
// SHADOW
linear-gradient(
-10.3deg,
rgba(red,.0) 45%,
rgba($t,.4),
rgba($t,.3),
rgba(blue,.0) 60%,
)
33% 52.5% / 15em 3em,
// vr L
linear-gradient(
to right,
rgba(red,.0) 45%,
rgba($t,.1),
rgba($t,.4),
rgba(blue,.0) 53%,
)
26.8% 54% / 5em 1.2em,
linear-gradient(
-10.3deg,
rgba(red,.0) 45%,
rgba($t,.1),
rgba($t,.4),
rgba(blue,.0) 53%,
)
30.4% 51.5% / 8em 3em,
linear-gradient(
-10.3deg,
rgba(red,.0) 45%,
rgba($t,.1),
rgba($t,.4),
rgba(blue,.0) 53%,
)
33% 52.5% / 15em 3em,
// END LEFT LG LINES
// LEFT SM LINES
// vr L
linear-gradient(
to right,
rgba(red,.0) 45%,
rgba($t,.1),
rgba($t,.4),
rgba(blue,.0) 53%,
)
25% 57.9% / 5em .8em,
// vr R
linear-gradient(
to right,
rgba(red,.0) 45%,
rgba($t,.1),
rgba($t,.4),
rgba(blue,.0) 53%,
)
30.5% 56.1% / 5em .8em,
// hr
linear-gradient(
-10.3deg,
rgba(red,.0) 45%,
rgba($t,.1),
rgba($t,.4),
rgba(blue,.0) 53%,
)
27.8% 56.5% / 5em 3em,
// hr
linear-gradient(
-10.3deg,
rgba(red,.0) 45%,
rgba($t,.1),
rgba($t,.4),
rgba(blue,.0) 53%,
)
27.8% 58% / 5em 3em,
// hr shadow pink
linear-gradient(
-10.3deg,
rgba(red,.0) 45%,
rgba(#000,.7),
rgba(#000,.4),
rgba(blue,.0) 53%,
)
27.8% 56.7% / 5em 3em,
// hr shadow pink
linear-gradient(
-10.3deg,
rgba(red,.0) 40%,
rgba(#FEA395,1),
rgba(#FEA395,.4),
rgba(blue,.0) 53%,
)
27.8% 57% / 5em 3em,
// hr shadow dark
linear-gradient(
-10.3deg,
rgba(red,.0) 37%,
rgba(#333,.1),
rgba(#333,.4),
rgba(blue,.0) 53%,
)
27.8% 57.6% / 5em 3em,
// hr shadow dark
linear-gradient(
-10.3deg,
rgba(red,.0) 37%,
rgba(#333,.1),
rgba(#333,.4),
rgba(blue,.0) 53%,
)
27.8% 57.6% / 5em 3em,
// END LEFT SM LINES
//END TOP METAL middle dark lines
linear-gradient(
to right,
rgba(red,.0) 34%,
rgba($t,.3)36%,
rgba(red,.0) 39%,
)
23.3% 56.1% / 2em 2.7em,
// TOP METAL CORNER
linear-gradient(
to right,
rgba(red,.0) 35%,
rgba(#fff,.3),
$t 45%
)
24.5% 57.3% / 4.2em 4em,
linear-gradient(
rgba(#E8E7ED,1) 40%,
rgba(#E8E7ED,1) 41%,
)
26.6% 55% / 15em 2.5em,
linear-gradient(
-4.8deg,
rgba(#E8E7ED,1) 60%, rgba($t,.0) 61%,
)
27.5% 52.6% / 18em 3.6em,
// END TOP METAL
linear-gradient(
176deg,
rgba($bk,1) 60%, rgba($t,.0) 61%,
)
22% 16.6% / 22em 10em,
linear-gradient(
96deg,
rgba($bk,1) 60%, rgba(#FBC6BE,0) 61%,
)
13.6% 28% / 10em 13em,
rgba(blue,.0)
;
background-repeat: no-repeat;
}
&:before{
content: '';
width: 100em;
height: 85em;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45.5deg);
background:
linear-gradient(
rgba(#FFEEEA,1) 49%, rgba(#FBC6BE,1) 51%,
)
17.5% 67.4% / 10em 10em,
;
background-repeat: no-repeat;
}
}
.bk{
background-image: none;
}
.opacity{
opacity: .3;
}
Also see: Tab Triggers