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>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Minima esse delectus obcaecati. Sed facere unde consectetur distinctio asperiores illo eveniet aut enim minima in consequuntur soluta, ullam nihil repellat praesentium temporibus sunt voluptates libero saepe! Dolores ex facere rerum ab eius sed beatae ipsum reprehenderit explicabo, ipsa doloribus magnam quasi corporis, delectus, natus voluptatum suscipit. Rerum minima ratione harum molestias optio praesentium facilis, suscipit perferendis voluptates magni magnam. Esse fuga, aspernatur nemo enim perferendis, consequatur obcaecati voluptas eveniet eaque necessitatibus recusandae dolorum ullam tempora! A eaque optio cum aperiam quos consequatur quidem iusto veritatis sed, voluptas enim voluptatum voluptatibus architecto fugit necessitatibus aut illo fugiat doloribus soluta illum? Repudiandae quam labore sequi adipisci neque architecto maxime, eius, voluptatum doloribus molestias officia officiis delectus accusamus vero fugiat ad culpa vitae deserunt unde incidunt, sit nisi non! Error veritatis quia possimus, praesentium necessitatibus debitis corporis iure dolores vero quisquam ratione exercitationem reprehenderit autem molestiae cumque consequuntur. Vero amet eligendi, eaque architecto dignissimos alias sint dolorem ad nostrum maxime ab, obcaecati porro impedit sapiente ipsum. Assumenda sint sequi animi voluptate pariatur. Obcaecati distinctio maiores tempora voluptatem totam ad, est provident velit? Officia, consequatur magnam dignissimos excepturi reiciendis repellendus odit ab quisquam nulla cupiditate temporibus aspernatur enim asperiores iusto inventore id animi ad sunt libero officiis quos eaque accusantium dolorem! Unde alias veniam labore eligendi, earum illum ad officiis aliquam itaque nulla aut minima illo accusantium, ipsam accusamus officia reiciendis corporis magni facere dolor sequi? Animi nemo iusto, iure enim dicta cumque totam cum cupiditate consequatur a quidem laboriosam, voluptatum doloremque? Corrupti quos iusto necessitatibus tenetur, optio, iure placeat blanditiis magnam iste ex explicabo, totam culpa autem consectetur ipsa voluptate. Dolorem inventore nemo quas repellat harum animi, illo error, minus explicabo nulla cupiditate illum molestias aspernatur officiis eos quam. Dolorum architecto officia dicta non. Eveniet natus aliquam qui nisi dolores rem iste nihil illum voluptatem, tempore iusto repudiandae assumenda ad nam reiciendis quae repellat ipsam omnis dignissimos autem itaque! Repudiandae esse unde saepe fugit odio, dolor aliquid architecto. Sunt vitae, reprehenderit repellendus, necessitatibus sint quos nostrum voluptas error libero sequi accusamus, nesciunt earum rerum at deleniti placeat! Cupiditate quo vel aspernatur expedita voluptas ducimus, necessitatibus nesciunt blanditiis corporis exercitationem qui dolor commodi voluptatibus enim non facere neque in? Rem dolores harum possimus inventore? Sed sunt iusto amet at eveniet quam quisquam laborum dolorem enim beatae necessitatibus vel, assumenda magni voluptatem libero! Temporibus, explicabo ea? Rerum, illum. Quos quam unde eveniet, et accusamus voluptate voluptatem cupiditate, voluptates, eum corporis commodi mollitia veritatis sit omnis quidem eos tenetur adipisci dignissimos excepturi consequatur aspernatur? Voluptatibus consectetur ducimus iusto porro hic architecto quia, reprehenderit rerum, adipisci accusantium minus culpa deleniti libero cupiditate, repellendus impedit vel aliquam dignissimos. Corrupti libero, eaque dicta officia vero magnam alias dolorem magni omnis quidem, qui sequi, nulla voluptate illum sed inventore placeat deserunt deleniti possimus pariatur dolorum eius facilis nemo! Eius voluptas odio molestias praesentium excepturi quia voluptates, qui explicabo quibusdam nihil expedita earum repellat fugit aut minus repellendus sit ex et. Harum, eum. Odio nisi illo necessitatibus consequatur sint aliquam nam voluptatem, vel repellat, explicabo ex velit, maxime placeat porro. Blanditiis repellat accusamus dignissimos ex aliquid quam possimus corporis inventore perferendis, dolor amet ipsam repellendus error voluptas? Ea, magnam? Exercitationem libero ad neque necessitatibus, obcaecati temporibus doloribus officia nobis accusantium. Repellendus fuga aliquam minima laborum distinctio, ex numquam molestias ducimus amet iure similique corrupti neque ea facere voluptatibus quam adipisci perferendis quis magni deleniti suscipit! Delectus alias id natus, aperiam reprehenderit possimus. Sed ratione fugiat voluptates rem, voluptate amet ad culpa minima tempore totam, nemo error in sunt, iste nulla consequuntur doloribus incidunt perspiciatis ab! Corrupti aut est voluptatum delectus minima dolores sit nisi nam ad magni! Ex amet nihil obcaecati eaque quia alias aspernatur explicabo eius est pariatur deserunt accusantium, hic vero itaque magni voluptas nulla magnam quasi suscipit libero totam. Quis omnis, beatae modi delectus ex mollitia animi ea. Dicta eius hic repellendus iste? Nostrum, laborum tenetur repellendus odit ad consequatur delectus vel ipsam possimus consequuntur, cupiditate ratione? Cupiditate quod tempora modi saepe fugit numquam dicta, nostrum ab! Rerum libero omnis quae praesentium ex vitae voluptatibus ratione, voluptatum consectetur nobis tenetur deserunt architecto reiciendis dolorum necessitatibus hic unde natus perspiciatis temporibus distinctio fugiat aut, adipisci laboriosam! Quia iste consequuntur quas exercitationem fuga officia nemo commodi et fugiat. Nulla, placeat illum. Provident eos cumque minima, error reiciendis fugiat ratione a earum quam eius vero, libero consectetur! Delectus quam illo aliquid soluta fugit temporibus voluptates iste nostrum quae ipsam odio neque quas earum quia consequuntur asperiores, voluptatem et rerum ea, cupiditate dolor commodi iusto esse. Dicta adipisci expedita ex, perferendis sapiente illum ratione ad magni omnis molestiae numquam libero, recusandae praesentium veniam reiciendis saepe obcaecati deleniti accusamus officiis, et animi quos sunt dignissimos? Recusandae optio, corrupti est ipsam quam fugiat, voluptatem eos non suscipit vel aut nesciunt doloribus sit sed praesentium. </p>
<button onclick="myFunction()">Print this page</button>
</div>
@media print {
p {
widows: 25;
orphans: 5;
}
}
function myFunction() {
window.print();
}
Also see: Tab Triggers