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="box counter">
<div class="shape tri left"></div>
<div class="shape boat right"></div>
<div class="shape tri right"></div>
<div class="shape boat left"></div>
Mujer uno dolor más de poder, mismo si. Auto error décima, ex queso afortunado fuga números agua ataque, triste cuórum dignísimo molesto. Voluminoso materialidad recusado dolores expedición dignísimo, justo almácigo.
Demonio molesto, fotografía olvido temporalidad almácigo fantasía escolar, culpa crepúsculo patrón libertario trote resiliencia alma fugacidad obcecado y manantial. Repelente voluble crepúsculo ventana ex alveolar molesto magma ataque, cara pan.
Pan sapiencia síndrome león mirar demás, autoinmune accesorio volutas quindío números pócima. Corchea presentación cerro tonelada montaña autoinmune pócima suntuoso ex alias! Culpa décima velo chicharra vos necesariamente, corporal temporal?
Facilismo crepúsculo represión entero propósito materialidad magma corchea alveolar o tonelada! Corchea alias mosca paciencia? Alias tenedor, casi o deleznable paciencia repeler olvido tonelada modo fantasía litro velo séquito placenta.
Perspicacia tonelada incidente auto, repelente tenedor volutas dulce entero alma crepúsculo placenta preferencia demás dictado odio sintió cábala, como expedición, síndrome belleza séquito previsor corrupto números voluntad. Necesariamente, soluciones ex?
Soluciones, velo arquitecto demás ovni alma molestias pan racional temporalidad enigma fugacidad. No fuga previsor lejos. Explícito, amanecer computador entero natividad, y magma excepción, deletéreo alveolar perspicacia angustia autoinmune. Accesorio?
Inmune temporal y ovni excepción arquitecto mirar voluble repelente resiliencia alveolar expedición crepúsculo soluciones namibia cuórum, voluminoso paloma encefalograma corchea asunción oficinista dulce angustia débito computador letra a? Tasmania, molesto.
No pan comodidad, abadía materialidad columna abogada cerro adiposidad magma cara! Pan velo suntuoso laboral afortunado temporal? Molesto fotografía facilismo suntuoso tasmania consecuencia namibia? Paloma odio mirar oficinista facilismo error!
Litro vos paloma, nihilista distinción refugiado marejada sapiencia pócima corporal belleza mula laboriosamente décima corrupto. Adiposidad remo ataque quindío molde belleza pillo racional león animal agua. Voluminoso, presentación. Sintió, molde!
Anemia en facilismo nihilista explícito mínima mula, repugnante falda analfabeto repeler. Menos planeador corporal ataque ex voluntad décima expedición inmune almácigo? Crepúsculo previsor sintió tenedor molestias ex demás, repugnante alias?
</div>
body {
margin: 0 auto;
width: 100svw;
height: 100svh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-sizing: border-box;
overflow: hidden;
}
.box {
--width: 800px;
--gap: 2em;
font-size: 16px;
width: calc(var(--width) - var(--gap));
margin: 0;
aspect-ratio: 1 / 1;
overflow: hidden;
transform: rotate(-45deg);
text-align: justify;
hyphens: auto;
flex-shrink: 0;
}
.shape {
--m: calc(1 / 3);
shape-outside: var(--shape);
clip-path: var(--shape);
}
.shape.left {
float: left;
}
.shape.right {
float: right;
}
.shape.boat {
width: calc((var(--width) - var(--gap)) * var(--m) * 2);
aspect-ratio: 2 / 1;
}
.shape.tri {
width: calc((var(--width) - var(--gap)) * var(--m));
aspect-ratio: 1 / 2;
}
.shape.boat.left {
--shape: polygon(0 0, 50% 0, 100% 100%, 0 100%);
}
.shape.boat.right {
--shape: polygon(0 0, 100% 0, 100% 100%, 50% 100%);
}
.shape.tri.left {
--shape: polygon(0 0, 100% 0, 0 50%, 100% 100%, 0 100%);
}
.shape.tri.right {
--shape: polygon(0 0, 100% 0, 100% 100%, 0 100%, 100% 50%);
}
Also see: Tab Triggers