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 URL's added here will be added as <link>
s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
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.
If the stylesheet 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 CSS 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.
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.
<nav>
Some navigation
</nav>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Recusandae enim possimus nisi modi sunt ea maiores fugit perspiciatis dicta totam saepe voluptatum inventore, consequuntur suscipit sequi nemo facilis consectetur quis!</p>
<p>Laboriosam ducimus sit nam deleniti sequi ad quas eligendi deserunt maiores eaque, sunt voluptatem perspiciatis suscipit, ipsa rem magnam. Rerum culpa consequatur adipisci dolorum minus magnam, doloribus magni fugit praesentium.</p>
<p>Porro totam dolorem, dicta in tempore exercitationem natus placeat, nesciunt eos reprehenderit sed, beatae fugiat iste quidem consequatur quaerat officia praesentium voluptatum. Provident aliquid officia non libero esse sed mollitia.</p>
<p>Exercitationem sed autem consectetur totam nisi velit soluta, ad mollitia eveniet. Veritatis dicta corrupti quaerat quam! Corrupti, iste mollitia incidunt reiciendis fugiat unde optio necessitatibus ad, sit illum maiores delectus.</p>
<p>Alias porro veritatis nostrum ipsa repudiandae quod delectus dicta nihil qui asperiores! Non nisi hic natus, veniam fugiat provident iure ad consectetur veritatis quia, quaerat rem officiis libero ab sapiente.</p>
<p>Eaque quo saepe, dignissimos, et ad numquam tenetur nemo reprehenderit dicta ipsa unde consequuntur, pariatur corrupti iusto fugit? Nostrum eaque et itaque eligendi hic fuga. Obcaecati quam corporis ratione doloremque.</p>
<p>Recusandae, fuga accusamus odio doloremque at dolorum nisi possimus libero saepe aspernatur incidunt quam illo! Sint beatae modi aliquam suscipit ut blanditiis vel ratione molestiae quisquam dignissimos nesciunt, dolores labore.</p>
<p>Hic nostrum quia veritatis excepturi id reiciendis rerum vero! Quos assumenda iure quasi ex sed beatae eligendi animi iusto ab dolorum numquam nulla molestias, velit quam repudiandae architecto dolores sit!</p>
<p>Voluptas asperiores explicabo odio. Fuga ab vel aut excepturi doloremque earum nisi ut deserunt voluptate quas totam recusandae officia alias qui, eius incidunt a enim quos illo numquam consequuntur inventore.</p>
<p>Repellendus, impedit natus? Dolor, assumenda, ut adipisci impedit rem tenetur incidunt in dolorum voluptatem mollitia dolore exercitationem, eveniet quia optio reprehenderit quam sequi ducimus! Atque quis adipisci tenetur soluta necessitatibus.</p>
<p>Ad impedit suscipit rem sunt, non vero? Explicabo blanditiis voluptates itaque, consequatur soluta omnis nulla impedit tempore nam a totam sint dolore corporis iusto, amet molestias recusandae rerum obcaecati similique.</p>
<p>Ipsum eum laudantium sint corporis ut nemo, reprehenderit accusamus quas, non libero ab illo voluptatem nostrum quae aut nihil provident nesciunt minima quia debitis inventore consectetur? Animi aut necessitatibus repellat.</p>
<p>Quia enim error cumque voluptatem dolores sequi, eveniet et quo molestiae dolore unde minima porro beatae perferendis. Quam qui non eos reiciendis, veniam nobis mollitia ea repudiandae earum, magnam iure!</p>
<p>Sapiente ex harum dolorem debitis sunt ullam temporibus veritatis aut suscipit alias facere nostrum incidunt possimus quod est, nam dolore perspiciatis optio deleniti soluta magni? Cum id consectetur tempore impedit.</p>
<p>Repellat sed eveniet quos blanditiis doloribus dolorem odit quo architecto obcaecati incidunt laboriosam veniam perferendis harum animi, deleniti sunt tempora optio ut hic rerum explicabo esse molestiae. Ea, nesciunt magni.</p>
<p>Corrupti ea deleniti quisquam animi aliquid quibusdam autem excepturi odit doloremque dignissimos. Earum beatae quae ea illum, soluta iusto pariatur accusantium eaque mollitia libero, facere sequi? Harum quae provident tempora.</p>
<p>Vel in culpa alias quam, odit autem ab, unde reiciendis nostrum explicabo fugit quas numquam officiis, natus harum ipsum dolore quis dolores! Eveniet eum accusantium, dicta facere commodi ducimus odio.</p>
<p>Ullam voluptas, ex, corrupti a vero omnis consectetur sit debitis consequuntur expedita soluta libero magni nihil, illo distinctio saepe nulla ipsa ducimus. Officiis, adipisci. Exercitationem, quidem facere? Vero, quos fugit!</p>
<p>Rem ipsa blanditiis, aspernatur suscipit provident omnis. Mollitia voluptas corporis ducimus dolore! Quos ducimus numquam asperiores quidem dolorum magnam possimus cupiditate inventore recusandae ex ea, quisquam id temporibus eveniet dolorem!</p>
<p>Libero modi nam quibusdam nisi dolor quasi corporis cum deleniti consectetur, facilis pariatur assumenda laborum eaque sit ea omnis vitae debitis maxime vel, provident voluptas labore asperiores? Autem, accusantium nam?</p>
body {
margin: 0;
height: 100vh;
}
nav {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: black;
color: white;
padding: 20px;
}
Also see: Tab Triggers