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="columns">
<div class="vh">vh</div>
<div class="lvh">lvh</div>
<div class="svh">svh</div>
<div class="dvh">dvh</div>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Expedita, itaque illum eligendi hic tempore assumenda optio, soluta rem repellendus exercitationem deleniti accusantium? Dolores reprehenderit nesciunt saepe quasi alias iure reiciendis laborum quis tempore beatae consectetur sed nemo incidunt excepturi sequi nam cupiditate optio, pariatur doloremque aperiam dicta! Totam ullam perferendis porro tenetur dolor recusandae, reprehenderit fuga dolorum veniam iste architecto vero et hic inventore quasi ipsam commodi dolore dolores consequuntur ab corporis provident ex nemo? Accusamus, maxime ducimus. Eligendi, in. Doloremque maiores corporis, iste earum at aliquam laboriosam sint nostrum obcaecati quasi voluptate dolor dolorem quidem, iusto cupiditate et placeat aperiam sequi nisi corrupti ipsum! Placeat eligendi quos totam molestias porro repellat sed alias soluta dicta ab recusandae reiciendis id doloremque inventore, quo est possimus reprehenderit. Sunt, nostrum est hic deserunt eos voluptatibus eum tempore quaerat earum praesentium, fuga, iure saepe placeat rerum maxime dolorem inventore blanditiis consectetur at corporis odit sed! Saepe optio rem fuga voluptate. Culpa, ducimus a. Fuga nobis porro sunt sit. Aperiam officiis blanditiis vel itaque provident distinctio laborum aspernatur a, tempore, dolore quibusdam, quia quis animi nulla voluptas. Dolorem maiores, porro sint error vitae laudantium consequatur accusamus architecto assumenda quibusdam dolores dicta sunt officia veritatis impedit omnis eius esse distinctio vero consectetur unde provident modi cum. Ex quo odit dolorem numquam delectus dolores maxime at vel quas iusto aut aliquam natus error velit fuga atque ipsam voluptatum eveniet praesentium sapiente, quibusdam fugiat sit nesciunt? Nostrum sapiente unde nisi repellendus nesciunt velit! At in vitae quam ea autem iste quod fuga distinctio commodi natus saepe, totam numquam aperiam laudantium vero fugit, reprehenderit veniam accusamus enim delectus vel. Et nobis, harum quas odit aperiam consequatur, eius doloribus laborum nam sunt iusto distinctio ipsum deserunt reiciendis voluptatibus fugiat voluptates alias animi, accusamus assumenda. Odit nisi nulla ab quae dicta harum neque repudiandae illum maxime quia voluptate adipisci quo, sunt suscipit ipsa, nemo maiores magnam quos, optio vitae amet? Eos sit iste, commodi provident hic at optio ullam inventore nulla, illo, exercitationem voluptate quo saepe molestias dolorem. Nam fugiat assumenda, sint amet nihil, soluta ipsam repellendus natus molestias qui perferendis, est doloremque eum ad reprehenderit cum beatae repellat sunt doloribus? Quae laboriosam ipsum, fugit quaerat consequatur, culpa quas natus nostrum explicabo quibusdam ipsam ipsa, maiores exercitationem nam. Necessitatibus obcaecati, quidem ullam voluptates nobis cum dolores. Tempora quidem temporibus tenetur, sunt, rerum dolor cupiditate esse beatae ex consequuntur iusto, nobis mollitia adipisci odio quia ipsam natus qui vero delectus architecto. Dolore ipsa ea laborum dolor recusandae, impedit culpa soluta, doloribus repellendus aliquid quasi pariatur dicta ducimus maxime fuga, tenetur sunt veniam cumque quod itaque possimus perspiciatis! Inventore expedita aperiam quasi iste porro aliquid nam accusamus harum eius vel, praesentium quisquam dolore molestias ad itaque ipsam, vero ducimus! Vitae aperiam vero porro totam molestiae sunt laborum inventore non, consequuntur recusandae sequi, facilis explicabo fugit maiores ut nesciunt suscipit fuga voluptatibus laboriosam rem sapiente. Saepe quia molestiae adipisci numquam temporibus, voluptates soluta porro rem iure voluptas error, quaerat commodi dolorum placeat autem unde recusandae incidunt cumque, qui maxime! Consequuntur, numquam molestias. Esse beatae, ducimus eos temporibus laborum tempora consequuntur consequatur libero autem. Consectetur beatae, inventore quas assumenda rem sit ea sequi. Deleniti reprehenderit sunt, quos aperiam ratione ex ad enim molestias, veniam esse numquam laborum illo accusamus et praesentium cumque nemo temporibus quas. Tenetur, deleniti pariatur sequi laudantium, quis sint, impedit praesentium in quidem asperiores quod placeat. Voluptatibus eaque error enim laboriosam ipsum ducimus eligendi fuga neque veritatis eos quibusdam dolores recusandae necessitatibus, quam fugiat dolore voluptatum porro, beatae ullam. Natus corrupti dolores asperiores maxime enim deserunt sint eaque nihil dolorem inventore nostrum vero consequuntur possimus repudiandae, quod a! Officiis a et, facilis velit consequuntur excepturi numquam sunt ipsam deserunt deleniti molestias harum repellat placeat, quo voluptatem pariatur eum aliquid corrupti voluptates! At dicta repellat nisi iste commodi consequatur quae delectus temporibus ut dolorem iusto nulla tempora labore molestiae tempore, in architecto sed magnam aliquid distinctio animi tenetur deserunt dolor? Quam, consequatur animi omnis incidunt voluptatibus similique vero excepturi! Molestiae dolores in accusamus quidem hic illo saepe consequuntur quo. Esse nulla in assumenda adipisci, nemo rem, accusamus eveniet delectus impedit repellendus ex nihil ducimus officiis libero consequuntur et veritatis illo quis nam provident dicta! Saepe pariatur illum fugit tempore, tempora, dolor quo, animi et eum perspiciatis reiciendis ex ut ad autem? Vel voluptate ipsam, nemo expedita harum minima a distinctio corporis quos tenetur voluptatem ducimus eos rem iste commodi. Consectetur, hic facere. Dolor rem facere nisi atque qui ex ipsa, iure necessitatibus rerum suscipit tenetur nobis vel pariatur dolorem at voluptas a, doloribus reprehenderit quae optio sapiente! Asperiores obcaecati quisquam reprehenderit ex eveniet distinctio mollitia quasi adipisci eligendi blanditiis facilis consequuntur nisi nobis omnis, sit, suscipit soluta perspiciatis nulla tempore necessitatibus inventore! Consequuntur facilis praesentium voluptate corporis quaerat incidunt sit neque distinctio maiores. Esse, saepe consequuntur ex, molestiae inventore atque, reiciendis incidunt illo autem doloremque quo itaque quidem qui voluptates veniam! Provident natus atque sed libero nobis iste nostrum, vero culpa non, maxime facere dolores aut. Repellat corrupti veritatis ipsum. Eos, beatae unde. Nobis minima dolores repellat, voluptatibus debitis provident voluptate qui facere vero. Cupiditate labore in dignissimos voluptate hic porro quod ratione repellat perferendis ab atque error maiores molestias, dolores officiis? Repellat, tempora. Rerum a mollitia sint iste? Beatae ab ea, ex eos autem doloremque tenetur. Distinctio, adipisci? Expedita incidunt doloremque aspernatur vel voluptatibus. Velit corporis perferendis illum exercitationem, suscipit magnam amet ullam sunt eos doloremque cupiditate commodi totam natus accusantium mollitia excepturi asperiores! Obcaecati pariatur cum numquam dicta harum error, sit ut incidunt sunt atque quibusdam officia a consectetur accusamus odit possimus impedit saepe. Unde ratione quam officiis ex ullam nemo recusandae dolorem eum temporibus praesentium vel, odit magni, voluptatem, ipsam laudantium eligendi placeat deserunt atque non? Ea consectetur eaque, incidunt excepturi molestias dolorum fuga distinctio rerum amet, sed repellat culpa porro quas quis, laboriosam vel odit doloremque quia unde. Modi tenetur est, ipsam repellendus corporis, unde neque sunt earum, minima fuga exercitationem magnam. Iusto minus incidunt quod voluptatum commodi.</p>
.columns {
display: flex;
position: fixed;
inset: 0;
}
:where(.columns) div {
background: hwb(10 0% 0% / 0.95);
flex-grow: 1;
border: 1rem solid rgb(255 255 255 / 0.95);
outline: 1px solid #000;
padding-top: 1rem;
height: 100vh;
}
.lvh {
background: hwb(260 0% 0% / 0.95);
height: 100lvh;
}
.svh {
background: hwb(140 0% 0% / 0.95);
height: 100svh;
}
.dvh {
background: hwb(300 0% 0% / 0.95);
height: 100dvh;
}
body {
margin: 0;
font-size: 1.6rem;
font-family: sans-serif;
text-align: center;
font-weight: bold;
}
* {
box-sizing: border-box;
}
Also see: Tab Triggers