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 class="parent h-screen bg-gray-400 flex flex-col text-center">
<header class="bg-red-400 p-4">Header</header>
<main class="bg-green-400 flex-1">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi numquam rerum, perspiciatis atque cumque dolore quod repudiandae neque facilis voluptatibus incidunt laudantium accusantium tempora doloribus a, consectetur repellendus vero quisquam omnis alias. Molestias necessitatibus accusamus nam numquam perferendis tempora nobis dicta dolor porro non voluptatem esse quia animi sit obcaecati, placeat nulla omnis recusandae magnam natus debitis voluptatum. Eveniet aliquam quis totam quia quod quidem ullam dicta expedita illum enim sit dolor dolorum veritatis dolore reprehenderit, repellendus incidunt similique maiores est? Odio, ipsam possimus? Quasi maxime impedit sit sed quam officia tempore, corporis asperiores cum minus fuga exercitationem dolores ipsam possimus saepe, provident nostrum corrupti sapiente alias eos a nam nihil ullam. Consequatur, beatae illo sunt atque ipsam tenetur et, laudantium architecto dolorem velit blanditiis magnam incidunt possimus impedit ad cupiditate laborum voluptates reprehenderit quasi ducimus ut quas accusantium. Dolores, incidunt consequatur atque consectetur aperiam saepe soluta rerum repellat? Optio expedita quaerat ab similique sunt culpa necessitatibus ut atque eligendi consectetur saepe, quo quisquam consequatur sed molestiae nulla nemo voluptate natus laboriosam, eaque aliquid assumenda? Id fugiat sit vitae, natus quia nam maxime debitis repudiandae ullam minus cumque aperiam rerum labore modi laudantium esse nesciunt sapiente perspiciatis officiis saepe placeat eveniet expedita. Modi porro dicta nisi temporibus praesentium doloribus autem reprehenderit corporis in pariatur, optio aliquid nulla animi ipsum assumenda odio iste libero quia provident vel totam dolorum. Deserunt numquam, harum laboriosam perferendis et architecto in officia qui dolorem nisi culpa adipisci quaerat nihil doloribus quidem alias consequatur, similique facere. Deserunt, iusto ad suscipit beatae ex, eligendi reprehenderit eveniet ipsum libero dignissimos fugiat recusandae quas quisquam? At voluptatem deserunt magnam minus vero distinctio esse voluptate quis fuga, minima pariatur fugit alias quod, iure et libero numquam obcaecati dolore expedita consequuntur nihil cupiditate. Necessitatibus quod facilis soluta aut quisquam, minus similique? Perspiciatis a laborum veritatis alias voluptatibus sit modi nihil ullam natus dicta quidem quaerat tenetur nobis, nemo cupiditate facilis sequi temporibus. Ducimus, exercitationem eligendi animi ratione iusto explicabo illum ea! Hic doloribus quisquam ullam, cum nemo repudiandae facilis aliquam delectus impedit fuga nostrum nobis ad labore dolorem modi molestias incidunt eos non. Voluptas nesciunt nam sed aperiam repellat! Esse officia facere blanditiis nulla repellendus, magni doloremque atque maxime molestiae qui porro delectus labore dolores, fuga laborum dolorum enim, veniam est minus architecto. Atque dolore esse quibusdam enim incidunt nulla similique. Consequuntur placeat voluptate nihil dolor repellendus, similique nulla reprehenderit iste voluptatibus eligendi minus magnam iusto velit at repellat deserunt vitae neque quasi maxime molestiae ipsam veritatis. Nisi perspiciatis sed repellendus reprehenderit aliquam nostrum illo ut similique ab debitis, ratione, minima molestiae, fugiat iure corrupti? Nostrum dignissimos animi, officia eum ullam aperiam assumenda libero doloremque! Ullam aperiam nemo maxime quas molestias tempora placeat harum optio, quasi explicabo vitae laborum voluptas nesciunt non. Optio est asperiores maxime nemo, ipsam perferendis exercitationem amet. Aliquam, nam. Blanditiis, sapiente assumenda? Amet unde, voluptatem corporis rerum alias ad nostrum aliquid! Eius officiis tempore architecto dicta nihil nesciunt delectus voluptatibus dolore labore ipsam, similique porro illo animi?
</main>
<footer class="bg-blue-400 p-4">Footer</footer>
</div>
Also see: Tab Triggers