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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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 id="letter"></div>
// #divtober 28: Letter
// a.singlediv.com/divtober2020
body
min-height: 400px
height: 100vh
position: relative
background-color: peru
overflow: hidden
div
position: absolute
left: 50%
top: 50%
&:before,
&:after
display: block
content: ''
position: absolute
@media (max-width: 400px)
&:not(.no-scale)
transform: scale(.8)
#letter
font-size: 8px
width: 94%
max-width: 600px
height: 94%
max-height: 500px
transform: translateX(-50%)
top: auto
bottom: 0
background-color: floralwhite
background-repeat: no-repeat
background-image: repeating-linear-gradient(to right, darkgrey,
darkgrey .3em,
transparent .3em,
transparent 5em),
linear-gradient(136deg, transparent 49.5%,
darkgrey 50%,
darkgrey 53%,
transparent 53.5%),
linear-gradient( 44deg, transparent 46.5%,
darkgrey 47%,
darkgrey 50%,
transparent 50.5%),
repeating-linear-gradient(to right, darkgrey,
darkgrey .3em,
transparent .3em,
transparent 5em),
linear-gradient( 45deg, transparent 44%,
darkgrey 44.5%,
darkgrey 47%,
transparent 47.5%),
linear-gradient( 45deg, transparent 47%,
darkgrey 47.5%,
darkgrey 50%,
transparent 50.5%),
linear-gradient(136deg, transparent 32%,
darkgrey 32.5%,
darkgrey 36.5%,
transparent 37%),
linear-gradient(135deg, transparent 63.5%,
darkgrey 64%,
darkgrey 68%,
transparent 68.5%),
linear-gradient(136deg, transparent 46.5%,
darkgrey 47%,
darkgrey 50%,
transparent 50.5%),
linear-gradient( 44deg, transparent 49.5%,
darkgrey 50%,
darkgrey 53%,
transparent 53.5%),
radial-gradient(circle, peru 60%, alpha(peru,0) 61%),
radial-gradient(circle, peru 60%, alpha(peru,0) 61%),
linear-gradient(hotpink, hotpink),
repeating-linear-gradient(to bottom, paleturquoise,
paleturquoise .25em,
transparent .25em,
transparent 2.5em)
background-size: 10.30em 5em,
5.15em 5em,
5.15em 5em,
10.30em 5em,
6.18em 5em,
6.18em 5em,
5.15em 2.4em,
5.15em 2.5em,
5.15em 5em,
5.15em 5em,
3em 3em,
3em 3em,
.2em 100%,
100% 80%
background-position: right 14em top 10em,
right 19.15em top 5em,
right 14.01em top 5em,
right 14em top 20em,
right 18.1em top 15em,
right 13.4em top 15em,
right 19.15em top 17.6em,
right 14.01em top 15em,
right 14.01em top 25em,
right 19.15em top 25em,
3.4em 29%,
left 3.4em bottom -1.5em,
10em 0,
0 100%
&:before
width: 6.3em
height: 15em
right: 3.5em
top: 2em
background-repeat: no-repeat
background-image: repeating-linear-gradient(to right, darkgrey,
darkgrey .3em,
transparent .3em,
transparent 3em),
linear-gradient(136deg, transparent 49.5%,
darkgrey 50%,
darkgrey 54.5%,
transparent 55%),
linear-gradient( 44deg, transparent 45%,
darkgrey 45.5%,
darkgrey 50%,
transparent 50.5%),
repeating-linear-gradient(to right, darkgrey,
darkgrey .3em,
transparent .3em,
transparent 3em),
linear-gradient( 45deg, transparent 44%,
darkgrey 44.5%,
darkgrey 48.5%,
transparent 49%),
linear-gradient( 45deg, transparent 47%,
darkgrey 47.5%,
darkgrey 51.5%,
transparent 52%),
linear-gradient(136deg, transparent 32%,
darkgrey 32.5%,
darkgrey 38.5%,
transparent 39%),
linear-gradient(135deg, transparent 61%,
darkgrey 61.5%,
darkgrey 68%,
transparent 68.5%),
linear-gradient(136deg, transparent 45%,
darkgrey 45.5%,
darkgrey 50%,
transparent 50.5%),
linear-gradient( 44deg, transparent 49.5%,
darkgrey 50%,
darkgrey 54.5%,
transparent 55%)
background-size: 100% 3em,
50% 3em,
50% 3em,
100% 3em,
60% 3em,
60% 3em,
50% 1.5em,
50% 1.5em,
50% 3em,
50% 3em
background-position: 0 3em,
0 0,
100% 0,
0 9em,
0 6em,
2.8em 6em,
0 7.6em,
100% 6em,
100% 12em,
0 12em
transform: rotate(-15deg)
&:after
width: 4.3em
height: 10em
right: 4.5em
top: 18em
background-repeat: no-repeat
background-image: repeating-linear-gradient(to right, darkgrey,
darkgrey .3em,
transparent .3em,
transparent 2em),
linear-gradient(136deg, transparent 49%,
darkgrey 49.5%,
darkgrey 56.5%,
transparent 57%),
linear-gradient( 44deg, transparent 42.5%,
darkgrey 43%,
darkgrey 50%,
transparent 50.5%),
repeating-linear-gradient(to right, darkgrey,
darkgrey .3em,
transparent .3em,
transparent 2em),
linear-gradient( 45deg, transparent 44%,
darkgrey 44.5%,
darkgrey 50.5%,
transparent 51%),
linear-gradient( 45deg, transparent 44%,
darkgrey 44.5%,
darkgrey 51%,
transparent 51.5%),
linear-gradient(136deg, transparent 31%,
darkgrey 31.5%,
darkgrey 42%,
transparent 42.5%),
linear-gradient(135deg, transparent 57%,
darkgrey 57.5%,
darkgrey 68%,
transparent 68.5%),
linear-gradient(136deg, transparent 42.5%,
darkgrey 43%,
darkgrey 50%,
transparent 50.5%),
linear-gradient( 44deg, transparent 49%,
darkgrey 49.5%,
darkgrey 56.5%,
transparent 57%)
background-size: 100% 2em,
50% 2em,
50% 2em,
100% 2em,
60% 2em,
60% 2em,
50% 1em,
50% 1em,
50% 2em,
50% 2em
background-position: 0 2em,
0 0,
100% 0,
0 6em,
0 4em,
2em 4em,
0 5em,
100% 4em,
100% 8em,
0 8em
transform: rotate(-30deg)
// @lynnandtonic
// a.singlediv.com
Also see: Tab Triggers