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="feast"></div>
$test: #bada55;
$white: #ffffff;
$black: #020202;
$tan: #a77b51;
$brown: #9a6432;
$light-tan: #ffcc99;
$mid-tan: #cb9865;
$yellow: #ffcb66;
$orange: #ff6600;
$bg: #f0dac6;
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-color: $bg;
}
$box-w: -5vmin;
$box-h: 8vmin;
div.feast {
width: 90vmin;
height: 90vmin;
z-index: 9999;
display: flex;
transform: rotate(25deg);
margin: 0 auto;
position: relative;
background:
/* Bread */
radial-gradient(ellipse, darken($tan, 10%) 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 45vmin) calc(#{$box-h} + 25vmin) / 15vmin 55vmin no-repeat,
radial-gradient(ellipse, darken($yellow, 5%) 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 52vmin) calc(#{$box-h} + 27vmin) / 15vmin 55vmin no-repeat,
}
div.feast:before {
width: 100vmin;
height: 100vmin;
z-index: -99;
transform: rotate(-25deg);
background:
/* BREAD */
/* breadlines */
radial-gradient(ellipse at 130% 90%, transparent 8vmin, darken($yellow, 30%) 8vmin, darken($yellow, 30%) 8.5vmin, transparent 1vmin ) calc(#{$box-w} + 42vmin) calc(#{$box-h} + 50vmin) / 20vmin 20vmin no-repeat,
radial-gradient(ellipse at 130% 90%, transparent 8vmin, darken($yellow, 30%) 8vmin, darken($yellow, 30%) 8.5vmin, transparent 1vmin ) calc(#{$box-w} + 47vmin) calc(#{$box-h} + 50vmin) / 20vmin 20vmin no-repeat,
radial-gradient(ellipse at 130% 90%, transparent 8vmin, darken($yellow, 30%) 8vmin, darken($yellow, 30%) 8.5vmin, transparent 1vmin ) calc(#{$box-w} + 52vmin) calc(#{$box-h} + 50vmin) / 20vmin 20vmin no-repeat,
radial-gradient(ellipse at 50% 80%, $yellow 30vmin, transparent 1vmin ) calc(#{$box-w} + 30vmin) calc(#{$box-h} + 60vmin) / 75vmin 23vmin no-repeat,
/* Basket Lid */
radial-gradient(ellipse, $tan 5vmin, transparent 1vmin) calc(#{$box-w} + 59vmin) calc(#{$box-h} + 10vmin) / 10vmin 10vmin no-repeat,
radial-gradient(ellipse, $tan 3.25vmin, transparent 1vmin) calc(#{$box-w} + 34.75vmin) calc(#{$box-h} + -7.75vmin) / 6.5vmin 6.5vmin no-repeat,
radial-gradient(ellipse, $tan 3.25vmin, transparent 1vmin) calc(#{$box-w} + 75.5vmin) calc(#{$box-h} + 37.5vmin) / 6.5vmin 6.5vmin no-repeat,
linear-gradient(48deg, transparent 27vmin, $tan 27vmin, $tan 33.5vmin, transparent 1vmin) calc(#{$box-w} + 36.25vmin) calc(#{$box-h} + -6.25vmin) / 25vmin 45vmin no-repeat,
linear-gradient(-132deg, transparent 27vmin, $tan 27vmin, $tan 33.5vmin, transparent 1vmin) calc(#{$box-w} + 56vmin) calc(#{$box-h} + -2vmin) / 25vmin 45vmin no-repeat,
/* Basket */
radial-gradient(ellipse at 50% 0%, transparent 34vmin, $bg 34vmin) calc(#{$box-w} + 8vmin) calc(#{$box-h} + 60vmin) / 75vmin 23vmin no-repeat,
repeating-linear-gradient(90deg, lighten($light-tan, 10%) 0vmin, lighten($light-tan, 10%) 1.5vmin, transparent 1.5vmin, transparent 4vmin) calc(#{$box-w} + 18vmin) calc(#{$box-h} + 45vmin) / 18vmin 36vmin no-repeat,
repeating-linear-gradient(90deg, lighten($light-tan, 10%) 0vmin, lighten($light-tan, 10%) 1.5vmin, transparent 1.5vmin, transparent 4vmin) calc(#{$box-w} + 56vmin) calc(#{$box-h} + 45vmin) / 18vmin 36vmin no-repeat,
repeating-linear-gradient( lighten($light-tan, 10%) 0vmin, lighten($light-tan, 10%) 1.5vmin, transparent 1.5vmin, transparent 4vmin) calc(#{$box-w} + 13.5vmin) calc(#{$box-h} + 50vmin) / 66vmin 18vmin no-repeat,
linear-gradient(90deg, $tan 66vmin, transparent 1vmin) calc(#{$box-w} + 13.5vmin) calc(#{$box-h} + 45vmin) / 66vmin 36vmin no-repeat,
/* Bread */
radial-gradient(ellipse at 90% 130%, transparent 7vmin, darken($mid-tan, 30%) 7vmin, darken($mid-tan, 30%) 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 14.5vmin) calc(#{$box-h} + 22vmin) / 25vmin 15vmin no-repeat,
radial-gradient(ellipse at 90% 130%, transparent 7vmin, darken($mid-tan, 30%) 7vmin, darken($mid-tan, 30%) 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 14.5vmin) calc(#{$box-h} + 25vmin) / 25vmin 15vmin no-repeat,
radial-gradient(ellipse, $mid-tan 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 25vmin) calc(#{$box-h} + 16vmin) / 15vmin 55vmin no-repeat,
radial-gradient(ellipse at 90% 130%, transparent 7vmin, darken($mid-tan, 5%) 7vmin, darken($mid-tan, 5%) 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 24.5vmin) calc(#{$box-h} + 18vmin) / 25vmin 15vmin no-repeat,
radial-gradient(ellipse at 90% 130%, transparent 7vmin, darken($mid-tan, 5%) 7vmin, darken($mid-tan, 5%) 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 24.5vmin) calc(#{$box-h} + 21vmin) / 25vmin 15vmin no-repeat,
radial-gradient(ellipse, $light-tan 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 35vmin) calc(#{$box-h} + 10vmin) / 15vmin 55vmin no-repeat,
}
div.feast:after {
width: 100vmin;
height: 100vmin;
left: 1vmin;
z-index: -999;
transform: rotate(-46deg);
background:
/* FISH */
/* mouth */ linear-gradient(-105deg, $bg 2vmin, transparent 1vmin) calc(#{$box-w} + 10vmin) calc(#{$box-h} + 8vmin) / 10vmin 8vmin no-repeat,
/* gill */ radial-gradient(ellipse at 50% -30%, transparent 4vmin, darken($orange, 20%) 4vmin, darken($orange, 20%) 4.5vmin, transparent 1vmin ) calc(#{$box-w} + 18vmin) calc(#{$box-h} + 23vmin) / 10vmin 4vmin no-repeat,
/* eye */ radial-gradient(ellipse, darken($orange, 20%) 1vmin, transparent 1vmin ) calc(#{$box-w} + 24vmin) calc(#{$box-h} + 16vmin) / 2vmin 3vmin no-repeat,
/* fish */ radial-gradient(ellipse, $orange 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 12vmin) calc(#{$box-h} + 5vmin) / 20vmin 55vmin no-repeat,
/* mouth */ linear-gradient(-105deg, $bg 2vmin, transparent 1vmin) calc(#{$box-w} + 17vmin) calc(#{$box-h} + -1vmin) / 10vmin 8vmin no-repeat,
/* gill */ radial-gradient(ellipse at 50% -30%, transparent 4vmin, darken($orange, 10%) 4vmin, darken($orange, 10%) 4.5vmin, transparent 1vmin ) calc(#{$box-w} + 25.5vmin) calc(#{$box-h} + 12vmin) / 10vmin 4vmin no-repeat,
/* eye */ radial-gradient(ellipse, darken($orange, 10%) 1vmin, transparent 1vmin ) calc(#{$box-w} + 31vmin) calc(#{$box-h} + 7vmin) / 2vmin 2.5vmin no-repeat,
/* fish */ radial-gradient(ellipse, lighten($orange, 10%) 7.5vmin, transparent 1vmin ) calc(#{$box-w} + 20vmin) calc(#{$box-h} + -5vmin) / 20vmin 55vmin no-repeat,
}
/* Greg Robleto
cssartstudio.com */
Also see: Tab Triggers