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="flex flex-row-reverse">
<div class="bg-white text-black p-3">Lorem ipsum dolor sit amet consectetur adipiscing elit hendrerit, imperdiet vitae feugiat netus lacus praesent ullamcorper taciti, torquent vestibulum curae semper molestie condimentum dictumst. Vestibulum at magna non imperdiet urna sagittis erat aliquet libero, nec blandit donec cursus mollis porttitor sociis ad, nisl dapibus risus senectus turpis nulla habitasse ante. Mattis cursus turpis porttitor mauris aliquet donec placerat, vivamus netus conubia cum eget a interdum, risus torquent consequat metus curae senectus. Accumsan sem facilisi sollicitudin donec fermentum torquent, arcu habitasse integer condimentum ligula ante, morbi venenatis ultrices auctor suscipit. Nec nunc sem senectus pellentesque habitant nostra iaculis ullamcorper, viverra sociosqu tristique nulla potenti quis dapibus, morbi lectus condimentum tortor mauris vehicula a. Semper proin dapibus aliquam nunc cursus facilisis purus venenatis orci, diam ut hendrerit penatibus urna elementum etiam mollis ultrices, conubia class erat nisi maecenas curae tempus habitant. Fermentum lectus sociosqu magnis a nunc suscipit pharetra habitant dictumst, himenaeos eget aliquet sapien mi venenatis augue metus, suspendisse euismod vivamus tempus diam ornare volutpat condimentum. Ridiculus felis pellentesque non augue sodales per auctor vivamus primis, sed praesent scelerisque leo ac conubia porta nec. Volutpat lectus justo nullam condimentum faucibus velit varius nisl, vitae laoreet cubilia etiam ad rhoncus nam facilisi turpis, sagittis dictum senectus urna purus dui bibendum. Neque lacus imperdiet pharetra condimentum suscipit hac integer nascetur ad nam pretium massa, faucibus odio lacinia class ut cras diam cursus vehicula tempor. Varius tortor sociis viverra gravida etiam, sodales aliquet urna maecenas blandit, orci eget mollis suscipit. Ridiculus felis pellentesque non augue sodales per auctor vivamus primis, sed praesent scelerisque leo ac conubia porta nec. Volutpat lectus justo nullam condimentum faucibus velit varius nisl, vitae laoreet cubilia etiam ad rhoncus nam facilisi turpis, sagittis dictum senectus urna purus dui bibendum. Neque lacus imperdiet pharetra condimentum suscipit hac integer nascetur ad nam pretium massa, faucibus odio lacinia class ut cras diam cursus vehicula tempor. Varius tortor sociis viverra gravida etiam, sodales aliquet urna maecenas blandit, orci eget mollis suscipit.</div>
<div class="bg-gray-50 fixed bottom-0 overflow-visible w-full shadow-inner p-4 flex flex-row md:flex-col md:px-10 md:top-0 md:relative">
<div class="flex flex-1 justify-center text-xs font-bold text-center md:py-4 md:flex-none md:justify-start">
<a href="#" class="md:inline-flex md:gap-2">
<svg class="w-6 h-6 inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path></svg>
<span class="block text-xs pt-1">Home</span>
</a>
</div>
<div class="flex flex-1 justify-center text-xs font-bold text-center md:py-4 md:flex-none md:justify-start">
<a href="#" class="md:inline-flex md:gap-2">
<svg class="w-6 h-6 inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
<span class="block text-xs pt-1">Explore</span>
</a>
</div>
<div class="flex flex-1 justify-center font-bold text-center md:py-4 md:order-5 md:flex-none md:justify-start">
<a href="#" class="md:inline-flex md:gap-2">
<svg class="w-12 h-12 inline-block md:w-6 md:h-6 md:inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<span class="hidden md:block text-xs pt-1">Add</span>
</a>
</div>
<div class="flex flex-1 justify-center text-xs font-bold text-center md:py-4 md:flex-none md:justify-start">
<a href="#" class="md:inline-flex md:gap-2">
<svg class="w-6 h-6 inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>
<span class="block text-xs pt-1">Search</span>
</a>
</div>
<div class="flex flex-1 justify-center text-xs font-bold text-center md:py-4 md:flex-none md:justify-start">
<a href="#" class="md:inline-flex md:gap-2">
<svg class="w-6 h-6 inline-block" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
<span class="block text-xs pt-1">Config</span>
</a>
</div>
</div>
</div>
Also see: Tab Triggers