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="grid-container">
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias repellendus commodi architecto fugit ad accusantium rerum libero atque, ipsa, quaerat, aperiam amet mollitia excepturi inventore praesentium dolor perferendis, voluptas similique pariatur eius neque. Est.</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos sit cum ut. Nam eveniet corrupti inventore?</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut, veritatis praesentium deserunt deleniti. Ratione modi architecto illo pariatur, quaerat eveniet nam sit error cupiditate vel quisquam sequi totam natus hic iusto fugiat rerum culpa asperiores reiciendis assumenda, iure perspiciatis perferendis. Quas corporis id porro ab autem fuga deleniti maxime ducimus officiis ipsa, iste, repellat corrupti dolore perferendis saepe consectetur, expedita laborum placeat. Explicabo commodi expedita iusto, eius voluptas quam provident, aliquam optio. Autem quis necessitatibus tempora quia aperiam.</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam doloremque temporibus quos, enim sapiente, error delectus perspiciatis minima! Corporis tempora officia rerum vitae sint deserunt unde, nisi pariatur cupiditate! Cumque laboriosam, nihil vero reiciendis.</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa officia, repellat, aut delectus sit consectetur quas molestiae iure beatae optio dignissimos reiciendis enim.</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore, laboriosam placeat aut reprehenderit! Aliquam nostrum quia, eaque fugiat veritatis, natus dolores esse necessitatibus quis, enim odit molestiae, iusto et neque vel itaque! Debitis ea perferendis quae excepturi, autem atque minus, maiores. Harum voluptate ea suscipit, nihil explicabo distinctio tenetur beatae sint unde dolorum minus nobis odio provident culpa natus eos ipsum architecto ad dignissimos magnam fugit aliquam, similique illum! Natus suscipit, atque, alias voluptatibus sint illum delectus consectetur harum quisquam. Pariatur explicabo dicta, tempore ad? Nulla dignissimos beatae, quisquam tempore quae ullam. Inventore exercitationem amet doloribus quis perferendis necessitatibus magni debitis aliquid, rerum fugiat. Natus.</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure error praesentium sed neque at ipsam rem in veniam id delectus perferendis quasi vero cumque veritatis architecto expedita atque, perspiciatis accusantium dignissimos non nihil odit. Vero maxime numquam necessitatibus amet aliquam dolorum dolor soluta!</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt quia quo, quibusdam.</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea ipsam expedita beatae adipisci saepe labore, obcaecati praesentium laudantium sit minima veritatis consectetur possimus vero!</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla quibusdam facere, quod saepe modi sint aut repellendus assumenda, possimus dolores eum odit amet nihil. Deleniti et, quam fugit vel ipsum, consectetur laboriosam!</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consectetur commodi itaque blanditiis, sunt, velit eveniet, aperiam facilis quas corporis ipsam accusamus distinctio est soluta, accusantium ipsa dolore perferendis quod modi voluptatem nobis fuga corrupti! Maiores aperiam sapiente alias neque mollitia. Minima dolor et, sint molestias tempore praesentium nemo facilis labore incidunt, est aliquam voluptas aperiam, ducimus cumque? Perferendis porro at illo ut nobis nam recusandae maiores expedita asperiores. Deleniti nam autem fuga tenetur vel, hic omnis, ad, sed earum ea ullam, asperiores maiores libero dolore. Voluptas cumque, similique. Maxime, dicta iste quasi. Optio quaerat, odit odio magni! Consequuntur nesciunt explicabo recusandae in ipsam alias, expedita a! Veniam, similique sed illo. Magni repellat, possimus maiores ea nulla cum saepe suscipit velit!</div>
<div class="item">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel unde, saepe eos non libero illum nobis facere laboriosam eaque hic tempore, possimus quo quas.</div>
</div>
// Fonts
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,600);
// Colors
$grey-dark: #1d1f20;
$grey-middle: #343436;
$white: #fff;
$white-15: rgba($white, 0.15);
body {
font-family: 'Source Sans Pro', sans-serif;
font-size: 18px;
line-height: 26px;
color: $white-15;
background-color: $grey-dark;
}
.grid-container {
@media only screen and (max-width: 480px) {
column-count: 1;
}
@media only screen and (min-width: 481px) and (max-width: 620px) {
column-count: 2;
}
@media only screen and (min-width: 621px) and (max-width: 1023px) {
column-count: 3;
}
@media only screen and (min-width: 1024px) {
column-count: 4;
}
column-gap: 16px;
margin: 8px 16px;
.item {
background-color: $grey-middle;
margin: 8px 0;
padding: 21px;
display: inline-block;
}
}
Also see: Tab Triggers