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="fake"></div>
$test: #bada55;
$dark-blue: #001740;
$light-blue: #5089e0;
$biege: #dfdac7;
$peach: #ffa992;
$light-peach: #feb6a2;
$gray: #6d6d6d;
$white: #ffffff;
$black: #181a19;
div, div:before, div:after {
display: block;
content: '';
position: absolute;
box-sizing:border-box;
}
body {
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
background:
linear-gradient(lighten($dark-blue, 20%), lighten($dark-blue, 15%)) 0vw 0vh / 100vw 100vh no-repeat;
}
$box-w: 25vmin;
$box-h: 5vmin;
div.fake {
width: 80vmin;
height: 80vmin;
transform:scale(1.1);
border: solid 1.5vmin $biege;
border-radius: 4vmin;
display: flex;
margin: 0 auto;
position: relative;
background:
/* left sideburn */
radial-gradient(ellipse , $black 1vmin, transparent .75vmin) calc(#{$box-w} + 21vmin) calc(#{$box-h} + 38vmin) / 2vmin 7vmin no-repeat,
/* right sideburn */
radial-gradient(ellipse , $black 1vmin, transparent .75vmin) calc(#{$box-w} + 41.5vmin) calc(#{$box-h} + 38vmin) / 2vmin 6vmin no-repeat,
/* beard */
radial-gradient(ellipse , $black 2.5vmin, transparent 1vmin) calc(#{$box-w} + 27.5vmin) calc(#{$box-h} + 55.5vmin) / 5vmin 5vmin no-repeat,
radial-gradient(ellipse , $black 2.5vmin, transparent 1vmin) calc(#{$box-w} + 25vmin) calc(#{$box-h} + 55vmin) / 5vmin 4vmin no-repeat,
radial-gradient(ellipse at 100% 50%, $black 2vmin, transparent 1vmin) calc(#{$box-w} + 22.5vmin) calc(#{$box-h} + 50vmin) / 3vmin 7vmin no-repeat,
radial-gradient(ellipse at 100% 0%, transparent 5vmin, $black 5vmin, $black 8vmin, transparent 1vmin) calc(#{$box-w} + 25.5vmin) calc(#{$box-h} + 50.75vmin) / 5vmin 3.5vmin no-repeat,
radial-gradient(ellipse at 50% 100%, $black 3vmin, transparent 1vmin) calc(#{$box-w} + 22vmin) calc(#{$box-h} + 51.5vmin) / 14vmin 4.5vmin no-repeat,
radial-gradient(ellipse , $black 1.5vmin, transparent 1vmin) calc(#{$box-w} + 25vmin) calc(#{$box-h} + 53.5vmin) / 3vmin 3vmin no-repeat,
radial-gradient(ellipse , $black 2.5vmin, transparent 1vmin) calc(#{$box-w} + 30.5vmin) calc(#{$box-h} + 55.5vmin) / 5vmin 5vmin no-repeat,
radial-gradient(ellipse , $black 2.5vmin, transparent 1vmin) calc(#{$box-w} + 34vmin) calc(#{$box-h} + 55vmin) / 5vmin 4vmin no-repeat,
radial-gradient(ellipse , $black 1.5vmin, transparent 1vmin) calc(#{$box-w} + 36vmin) calc(#{$box-h} + 53.5vmin) / 3vmin 3vmin no-repeat,
radial-gradient(ellipse at 0% 50%, $black 2vmin, transparent 1vmin) calc(#{$box-w} + 38.5vmin) calc(#{$box-h} + 50vmin) / 3vmin 7vmin no-repeat,
radial-gradient(ellipse at 0% 0%, transparent 5vmin, $black 5vmin, $black 8vmin, transparent 1vmin) calc(#{$box-w} + 33.5vmin) calc(#{$box-h} + 50.75vmin) / 5vmin 3.5vmin no-repeat,
radial-gradient(ellipse at 50% 100%, $black 3vmin, transparent 1vmin) calc(#{$box-w} + 28vmin) calc(#{$box-h} + 51.5vmin) / 14vmin 4.5vmin no-repeat,
/* forehead */
radial-gradient(ellipse, $peach 6vmin, transparent 1vmin) calc(#{$box-w} + 27.5vmin) calc(#{$box-h} + 32.75vmin) / 10vmin 1vmin no-repeat,
radial-gradient(ellipse, $peach 8vmin, transparent 1vmin) calc(#{$box-w} + 25.5vmin) calc(#{$box-h} + 34.5vmin) / 14vmin 1vmin no-repeat,
radial-gradient(ellipse, $peach 6vmin, transparent 1vmin) calc(#{$box-w} + 27.5vmin) calc(#{$box-h} + 36vmin) / 10vmin 1vmin no-repeat,
/* left eye */
radial-gradient(ellipse at 50% 100%, $black 1.45vmin, transparent 1vmin) calc(#{$box-w} + 26vmin) calc(#{$box-h} + 41.5vmin) / 3vmin 2vmin no-repeat,
radial-gradient(ellipse, $peach 2.75vmin, transparent 1vmin) calc(#{$box-w} + 24.5vmin) calc(#{$box-h} + 40vmin) / 5.5vmin 5.5vmin no-repeat,
radial-gradient(ellipse at 50% 100%, transparent 2vmin,$black 2vmin, $black 3vmin, transparent 1vmin) calc(#{$box-w} + 24.25vmin) calc(#{$box-h} + 39.5vmin) / 6vmin 2vmin no-repeat,
/* right eye */
radial-gradient(ellipse at 50% 100%, $black 1.45vmin, transparent 1vmin) calc(#{$box-w} + 35.25vmin) calc(#{$box-h} + 41.5vmin) / 3vmin 2vmin no-repeat,
radial-gradient(ellipse, $peach 2.75vmin, transparent 1vmin) calc(#{$box-w} + 34vmin) calc(#{$box-h} + 40vmin) / 5.5vmin 5.5vmin no-repeat,
radial-gradient(ellipse at 50% 100%, transparent 2vmin,$black 2vmin, $black 3vmin, transparent 1vmin) calc(#{$box-w} + 33.75vmin) calc(#{$box-h} + 39.5vmin) / 6vmin 2vmin no-repeat,
/* nose */
radial-gradient(ellipse, $peach .75vmin, transparent .75vmin) calc(#{$box-w} + 30.25vmin) calc(#{$box-h} + 38.5vmin) / 1.5vmin 1.5vmin no-repeat,
radial-gradient(ellipse, $peach .75vmin, transparent .75vmin) calc(#{$box-w} + 32.25vmin) calc(#{$box-h} + 38.5vmin) / 1.5vmin 1.5vmin no-repeat,
radial-gradient(ellipse, $peach 1.2vmin, transparent 1vmin) calc(#{$box-w} + 31vmin) calc(#{$box-h} + 40.5vmin) / 2vmin 9vmin no-repeat,
radial-gradient(ellipse, $peach 3.6vmin, transparent 1vmin) calc(#{$box-w} + 29vmin) calc(#{$box-h} + 46.75vmin) / 6vmin 2vmin no-repeat,
/* mouth */
radial-gradient(ellipse, $peach 4vmin, transparent 1vmin) calc(#{$box-w} + 28.5vmin) calc(#{$box-h} + 51.75vmin) / 7vmin .75vmin no-repeat,
radial-gradient(ellipse at 50% 100%, $light-peach 6.75vmin, $peach 6.75vmin, $peach 7vmin, transparent 1vmin) calc(#{$box-w} + 24.75vmin) calc(#{$box-h} + 46vmin) / 15.5vmin 9vmin no-repeat,
radial-gradient(ellipse, $black 5vmin, transparent 1vmin) calc(#{$box-w} + 27vmin) calc(#{$box-h} + 25.25vmin) / 10vmin 6vmin no-repeat,
/* face */
radial-gradient(ellipse, $light-peach 9vmin, transparent 1vmin) calc(#{$box-w} + 33.75vmin) calc(#{$box-h} + 36vmin) / 8vmin 6vmin no-repeat,
radial-gradient(ellipse, $light-peach 9vmin, transparent 1vmin) calc(#{$box-w} + 22.75vmin) calc(#{$box-h} + 36vmin) / 8vmin 6vmin no-repeat,
radial-gradient(ellipse, $light-peach 4vmin, transparent 1vmin) calc(#{$box-w} + 28vmin) calc(#{$box-h} + 30vmin) / 8vmin 6vmin no-repeat,
radial-gradient(ellipse, $light-peach 5vmin, transparent 1vmin) calc(#{$box-w} + 22.5vmin) calc(#{$box-h} + 30vmin) / 10vmin 13vmin no-repeat,
radial-gradient(ellipse, $light-peach 5vmin, transparent 1vmin) calc(#{$box-w} + 32vmin) calc(#{$box-h} + 30vmin) / 10vmin 13vmin no-repeat,
radial-gradient(ellipse, $light-peach 9vmin, transparent 1vmin) calc(#{$box-w} + 24vmin) calc(#{$box-h} + 34vmin) / 18vmin 18vmin no-repeat,
radial-gradient(ellipse, $black 7vmin, transparent 1vmin) calc(#{$box-w} + 30vmin) calc(#{$box-h} + 25.75vmin) / 14vmin 14vmin no-repeat,
radial-gradient(ellipse, $black 10vmin, transparent 1vmin) calc(#{$box-w} + 23vmin) calc(#{$box-h} + 27vmin) / 20vmin 20vmin no-repeat,
radial-gradient(ellipse, $black 10vmin, transparent 1vmin) calc(#{$box-w} + 20vmin) calc(#{$box-h} + 24vmin) / 20vmin 20vmin no-repeat,
/* head */
radial-gradient(ellipse, $light-peach 10vmin, transparent 1vmin) calc(#{$box-w} + 23.75vmin) calc(#{$box-h} + 35vmin) / 17vmin 22vmin no-repeat,
radial-gradient(ellipse, $light-peach 12vmin, transparent 1vmin) calc(#{$box-w} + 21.5vmin) calc(#{$box-h} + 29vmin) / 21.5vmin 22vmin no-repeat,
/* left side back */
radial-gradient(ellipse , $black 2vmin, transparent .75vmin) calc(#{$box-w} + 21.25vmin) calc(#{$box-h} + 41vmin) / 4vmin 8vmin no-repeat,
radial-gradient(ellipse , $black 1vmin, transparent 1vmin) calc(#{$box-w} + 22vmin) calc(#{$box-h} + 47vmin) / 2vmin 3vmin no-repeat,
radial-gradient(ellipse , $black 1vmin, transparent 1vmin) calc(#{$box-w} + 23vmin) calc(#{$box-h} + 49vmin) / 2vmin 3vmin no-repeat,
/* right side back */
radial-gradient(ellipse , $black 2vmin, transparent .75vmin) calc(#{$box-w} + 39.5vmin) calc(#{$box-h} + 41vmin) / 4vmin 8vmin no-repeat,
radial-gradient(ellipse , $black 1vmin, transparent 1vmin) calc(#{$box-w} + 41vmin) calc(#{$box-h} + 47vmin) / 2vmin 3vmin no-repeat,
radial-gradient(ellipse , $black 2vmin, transparent 1vmin) calc(#{$box-w} + 38vmin) calc(#{$box-h} + 47vmin) / 4vmin 6vmin no-repeat,
/* left ear */
radial-gradient(ellipse at 100% 50%, $peach 3.5vmin, transparent 1vmin) calc(#{$box-w} + 16.25vmin) calc(#{$box-h} + 38.25vmin) / 6vmin 11vmin no-repeat,
radial-gradient(ellipse at 100% 50%, $peach 2vmin, transparent 1vmin) calc(#{$box-w} + 19.5vmin) calc(#{$box-h} + 39.5vmin) / 3vmin 12vmin no-repeat,
/* right ear */
radial-gradient(ellipse at 0% 50%, $peach 3vmin, transparent 1vmin) calc(#{$box-w} + 43vmin) calc(#{$box-h} + 38.25vmin) / 4vmin 8vmin no-repeat,
radial-gradient(ellipse at 0% 50%, $peach 3vmin, transparent 1vmin) calc(#{$box-w} + 42vmin) calc(#{$box-h} + 37vmin) / 4vmin 14vmin no-repeat,
/* hair behind left ear */
/* hair behind right ear */
radial-gradient(ellipse at 100% 50% , $black 3.25vmin, transparent 1vmin) calc(#{$box-w} + 17vmin) calc(#{$box-h} + 30vmin) / 5.5vmin 13vmin no-repeat,
radial-gradient(ellipse , $black 1.75vmin, transparent .1vmin) calc(#{$box-w} + 19.5vmin) calc(#{$box-h} + 37vmin) / 3.5vmin 5vmin no-repeat,
/* hair behind right ear */
/* hair behind right ear */
radial-gradient(ellipse at 0% 50% , $black 3.25vmin, transparent 1vmin) calc(#{$box-w} + 42vmin) calc(#{$box-h} + 32vmin) / 5.5vmin 13vmin no-repeat,
radial-gradient(ellipse , $black 1.75vmin, transparent .1vmin) calc(#{$box-w} + 42vmin) calc(#{$box-h} + 37vmin) / 3.5vmin 5vmin no-repeat,
/* neck */
radial-gradient(ellipse, $light-peach 5vmin, transparent 1vmin) calc(#{$box-w} + 27vmin) calc(#{$box-h} + 50vmin) / 10vmin 12vmin no-repeat,
/* tie */
radial-gradient(ellipse, $black 1.5vmin, transparent 1vmin) calc(#{$box-w} + 30vmin) calc(#{$box-h} + 62.25vmin) / 3vmin 3vmin no-repeat,
linear-gradient(20deg, $black 2.5vmin, transparent 1vmin) calc(#{$box-w} + 27.5vmin) calc(#{$box-h} + 56vmin) / 5vmin 8vmin no-repeat,
linear-gradient(160deg, $black 2.5vmin, transparent 1vmin) calc(#{$box-w} + 27.5vmin) calc(#{$box-h} + 64vmin) / 5vmin 8vmin no-repeat,
linear-gradient(-20deg, $black 2.5vmin, transparent 1vmin) calc(#{$box-w} + 31vmin) calc(#{$box-h} + 56vmin) / 5vmin 8vmin no-repeat,
linear-gradient(-160deg, $black 2.5vmin, transparent 1vmin) calc(#{$box-w} + 31vmin) calc(#{$box-h} + 64vmin) / 5vmin 8vmin no-repeat,
/* shirt */
radial-gradient(ellipse, $white 6vmin, transparent 1vmin) calc(#{$box-w} + 26.5vmin) calc(#{$box-h} + 55vmin) / 12vmin 8vmin no-repeat,
linear-gradient(100deg, $white 7vmin, transparent 1vmin) calc(#{$box-w} + 31vmin) calc(#{$box-h} + 60vmin) / 18vmin 20vmin no-repeat,
linear-gradient(-100deg, $white 7vmin, transparent 1vmin) calc(#{$box-w} + 15.75vmin) calc(#{$box-h} + 60vmin) / 18vmin 20vmin no-repeat,
radial-gradient(ellipse, $black 8vmin, transparent 1vmin) calc(#{$box-w} + 25vmin) calc(#{$box-h} + 55vmin) / 16vmin 12vmin no-repeat,
linear-gradient(20deg, $black 22vmin, transparent 1vmin) calc(#{$box-w} + 38vmin) calc(#{$box-h} + 56vmin) / 17vmin 24vmin no-repeat,
linear-gradient(70deg, $black 6vmin, transparent 1vmin) calc(#{$box-w} + 55vmin) calc(#{$box-h} + 61vmin) / 15vmin 20vmin no-repeat,
linear-gradient(-25deg, $black 27vmin, transparent 1vmin) calc(#{$box-w} + 14vmin) calc(#{$box-h} + 58vmin) / 25vmin 22vmin no-repeat,
linear-gradient(-70deg, $black 7.5vmin, transparent 1vmin) calc(#{$box-w} + -.5vmin) calc(#{$box-h} + 62vmin) / 15vmin 20vmin no-repeat,
linear-gradient($light-blue 0vmin, lighten($light-blue, 15%) 25vmin) 0vw 0vh / 100vw 100vh no-repeat;
}
div.fake:after {
width: 45vmin;
height: 60vmin;
left: -5vmin;
top: -5vmin;
font-size: 5.5vmin;
padding: 3vmin;
font-weight: 600;
border-radius: 4vmin;
letter-spacing: .025vmin;
text-shadow: .5vmin .5vmin .5vmin darken($white, 15%);
font-family: 'Oswald', sans-serif;
color: $dark-blue;
content: 'THE PROBLEM WITH QUOTES FOUND ON THE INTERNET IS THAT THEY ARE OFTEN NOT TRUE.';
background:
linear-gradient($white 0vmin, lighten($white, 15%) 25vmin) 0 0 / 100vw 100vh no-repeat;
}
div.fake:before {
width: 40vmin;
height: 20vmin;
left: -2vmin;
top: 47vmin;
font-size: 3.5vmin;
font-weight: 300;
transform:scale(1);
z-index: 999;
color: darken($white, 40%);
font-family: 'Oswald', sans-serif;
content: '~ Abraham Lincoln';
background:
radial-gradient(ellipse at 110% 0%, $white 5vmin, $white 10vmin, transparent 10vmin) 12vmin 6vmin / 25vmin 15vmin no-repeat;
}
/* Greg Robleto
cssartstudio.com */
Also see: Tab Triggers