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.
c<div class="fall"></div>
$tan: #e6cda5;
$light-brown: #c78c55;
$dark-brown: #844414;
$yellow: #FEE25E;
$orange: #E77E22;
*, *:before, *:after {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
height: 100vmin;
position: relative;
z-index: 1;
background:
radial-gradient(lighten($yellow, 10%), lighten($orange, 10%));
}
div.fall {
width: 100vmin;
height: 100vmin;
left: -5vmin;
margin: -10vmin auto 0;
position: relative;
background:
/* Pumpkin */
radial-gradient(50% 60%, lighten($orange, 5%) 5vmin, transparent 5vmin) 42vmin 51vmin / 25vmin 25vmin no-repeat,
radial-gradient(50% 60%, $orange 5vmin, transparent 5vmin) 39vmin 51vmin / 25vmin 25vmin no-repeat,
radial-gradient(50% 60%, $orange 5vmin, transparent 5vmin) 45vmin 51vmin / 25vmin 25vmin no-repeat,
/* Pumpkin Stem */
// radial-gradient(55% 43% at 100% 100%, transparent 25%, #3fa12f 25% 50%, transparent 50%) 39% -13% / 30% 40% no-repeat,
radial-gradient(55% 43% at 100% 100%, transparent 3.5vmin, $dark-brown 3.5vmin, $dark-brown 5vmin, transparent 5vmin) 49vmin 48vmin / 10vmin 10vmin no-repeat,
/* lid-top/mid-right-shadow-mask */ linear-gradient(75deg, $dark-brown 0vmin, $dark-brown 7vmin, transparent 7vmin) 64vmin 22vmin / 20vmin 12.5vmin no-repeat,
/* lid-top/mid-right-shadow */ linear-gradient(75deg, darken($dark-brown, 3%) 0vmin, darken($dark-brown, 3%) 7vmin, transparent 7vmin) 66.5vmin 22vmin / 20vmin 12.5vmin no-repeat,
/* lid-top-left */ linear-gradient(-37deg, $dark-brown 0vmin, $dark-brown 10vmin, transparent 10vmin) 54vmin 22vmin / 16vmin 6.5vmin no-repeat,
/* lid-top-right */ linear-gradient(75deg, $dark-brown 0vmin, $dark-brown 5vmin, transparent 5vmin) 67.35vmin 22vmin / 20vmin 6.5vmin no-repeat,
/* lid-mid-shadow-left */ linear-gradient(-75deg, $dark-brown 0vmin, $dark-brown 3vmin, transparent 3vmin) 22vmin 29vmin / 20vmin 5vmin no-repeat,
/* lid-mid-shadow-left */ linear-gradient(-75deg, lighten($dark-brown, 5%) 0vmin, lighten($dark-brown, 5%) 3vmin, transparent 3vmin) 20vmin 29vmin / 20vmin 4.5vmin no-repeat,
/* lid-mid-center */ linear-gradient(0deg, $dark-brown 0vmin, $dark-brown 3vmin) 40vmin 28vmin / 30vmin 6.5vmin no-repeat,
/* lid-mid-left */ linear-gradient(-75deg, $dark-brown 0vmin, $dark-brown 5vmin, transparent 5vmin) 21vmin 28vmin / 20vmin 6.5vmin no-repeat,
/* lid-mid-right */ linear-gradient(75deg, $dark-brown 0vmin, $dark-brown 5vmin, transparent 5vmin) 69vmin 28vmin / 20vmin 6.5vmin no-repeat,
/* lid-bottom-line */ linear-gradient(0deg, darken($dark-brown, 7%) 0vmin, darken($dark-brown, 7%) 5vmin, transparent 5vmin) 36vmin 34.5vmin / 38.5vmin .5vmin no-repeat,
/* lid-bottom-left-shadow-mask */ linear-gradient(-70deg, $dark-brown 0vmin, $dark-brown 5vmin, transparent 5vmin) 21.5vmin 35.75vmin / 20vmin 3.25vmin no-repeat,
/* lid-bottom-left-shadow */ linear-gradient(-70deg, lighten($dark-brown, 5%) 0vmin, lighten($dark-brown, 5%) 5vmin, transparent 5vmin) 19.25vmin 35.75vmin / 20vmin 3.25vmin no-repeat,
/* lid-bottom-right-shadow-mask */ linear-gradient(70deg, $dark-brown 0vmin, $dark-brown 5vmin, transparent 5vmin) 69vmin 35vmin / 20vmin 5vmin no-repeat,
/* lid-bottom-right-shadow */ linear-gradient(70deg, darken($dark-brown, 3%) 0vmin, darken($dark-brown, 3%) 5vmin, transparent 5vmin) 72vmin 35vmin / 20vmin 5vmin no-repeat,
/* lid-bottom-center */ linear-gradient(0deg, $dark-brown 0vmin, $dark-brown 3vmin) 36vmin 35vmin / 38vmin 5vmin no-repeat,
/* lid-bottom-left */ linear-gradient(-70deg, $dark-brown 0vmin, $dark-brown 5vmin, transparent 5vmin) 18vmin 35vmin / 20vmin 5vmin no-repeat,
/* lid-bottom-right */ linear-gradient(70deg, $dark-brown 0vmin, $dark-brown 5vmin, transparent 5vmin) 72vmin 35vmin / 20vmin 5vmin no-repeat,
/* wrapper-shadow-right-mask */ linear-gradient(95deg, $tan 0vmin, $tan 7vmin, transparent 7vmin) 64vmin 50vmin / 10vmin 25vmin no-repeat,
/* wrapper-shadow-right */ linear-gradient(95deg, darken($tan, 5%) 0vmin, darken($tan, 5%) 7vmin, transparent 7vmin) 68vmin 50vmin / 10vmin 25vmin no-repeat,
/* wrapper-center */ linear-gradient(0deg, $tan 0vmin, $tan 3vmin) 45vmin 50vmin / 20vmin 25vmin no-repeat,
/* wrapper-left */ linear-gradient(-95deg, $tan 0vmin, $tan 10vmin, transparent 3vmin) 23vmin 50vmin / 22vmin 25vmin no-repeat,
/* wrapper-right */ linear-gradient(95deg, $tan 0vmin, $tan 10vmin, transparent 3vmin) 65vmin 50vmin / 23vmin 25vmin no-repeat,
/* base-shadow-left-mask */ linear-gradient(-95deg, $light-brown 0vmin, $light-brown 7vmin, transparent 7vmin) 37vmin 42vmin / 10vmin 45vmin no-repeat,
/* base-shadow-left */ linear-gradient(-95deg, lighten($light-brown, 5%) 0vmin, lighten($light-brown, 5%)7vmin, transparent 7vmin) 34vmin 42vmin / 10vmin 45vmin no-repeat,
/* base-shadow-top */ linear-gradient(-165deg, darken($light-brown, 3%) 0vmin, darken($light-brown, 3%) 7vmin, transparent 7vmin) 32vmin 40vmin / 40vmin 20vmin no-repeat,
/* base-shadow-right-mask */ linear-gradient(95deg, $light-brown 0vmin, $light-brown 7vmin, transparent 7vmin) 64.5vmin 40vmin / 10vmin 50vmin no-repeat,
/* base-shadow-right */ linear-gradient(95deg, darken($light-brown, 3%) 0vmin, darken($light-brown, 3%) 7vmin, transparent 7vmin) 68vmin 40vmin / 10vmin 50vmin no-repeat,
/* base-center */ linear-gradient(0deg, $light-brown 0vmin, $light-brown 3vmin) 45vmin 40vmin / 20vmin 50vmin no-repeat,
/* base-left */ linear-gradient(-95deg, $light-brown 0vmin, $light-brown 10vmin, transparent 3vmin) 25vmin 40vmin / 20vmin 50vmin no-repeat,
/* base-right */ linear-gradient(95deg, $light-brown 0vmin, $light-brown 10vmin, transparent 3vmin) 65vmin 40vmin / 20vmin 50vmin no-repeat,
}
/* This entry for day one of #divtober 2023 is for fall. The image is inspired by an iStockPhoto vector stock image and a similar tutorial by Coding Artist */
Also see: Tab Triggers