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.
<header>
<h1>Company</h1>
</header>
<nav>
<ul>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</nav>
<main>
<article>
<h2>Title of article</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium ipsum quasi soluta amet ab iusto deleniti blanditiis commodi, accusamus maxime impedit itaque et corporis eum suscipit aspernatur incidunt debitis repudiandae.</p>
<p>Enim quae est et repellendus doloribus delectus earum qui. Nemo similique, sint facere dicta aperiam suscipit odio saepe nam ex officiis rerum ut. Itaque veritatis eveniet error dolore rerum minus!</p>
<p>Voluptatem repellat enim magni ipsa consequuntur distinctio, dicta, optio, dolorem facere similique commodi, minus mollitia ut adipisci? Porro possimus odit minima, consectetur labore. Impedit, eligendi omnis id accusantium vel vitae.</p>
<p>Est sit hic ab expedita, sapiente? Dolorem consequuntur error ratione distinctio adipisci tempora, culpa officia maiores reprehenderit quasi dolores quam quibusdam dicta sed nemo ad deleniti quo, minus animi velit?</p>
<p>Omnis placeat harum, doloremque sint aspernatur. Pariatur inventore natus placeat aperiam odio ut tenetur sapiente cum quia architecto ad, possimus expedita. Veritatis maiores voluptatibus alias tempora, ipsa quibusdam doloribus voluptate.</p>
<p>Pariatur, dicta voluptatum quidem vero ipsam consectetur dignissimos ab nemo ullam debitis necessitatibus expedita hic perferendis architecto voluptates harum voluptate rem, qui fugiat ratione vel nesciunt. Aspernatur non perferendis repellendus.</p>
<p>Ab iusto cupiditate maxime suscipit, dolorum. Dignissimos dicta optio, qui accusantium, architecto perspiciatis, quis necessitatibus, quam nesciunt vel at tempore pariatur commodi expedita. Debitis nam, porro numquam ut ullam laudantium!</p>
<p>Ipsam iusto facilis dolorum error officia, atque minima laborum ullam consequatur assumenda temporibus illum cupiditate nesciunt facere veniam, eos cumque sapiente, culpa fugit quisquam ab. Officiis quam amet sit ab.</p>
<p>Quibusdam ab dolores illo delectus temporibus. Quod veritatis numquam aliquam commodi, porro dicta, quam consectetur nihil laborum fuga ullam, officia dolore debitis rerum possimus tempora magni voluptatem vero enim soluta.</p>
<p>Fugit voluptatum, a asperiores! Dolor repudiandae ea libero perferendis dolores commodi aliquid id fuga quam error minima tempora ex reiciendis excepturi suscipit eveniet accusamus doloremque placeat autem, fugiat. Laborum, repellendus.</p>
<p>Ducimus temporibus iusto ea eum similique debitis sit neque non quis nemo laudantium fuga, consequatur rem eius dignissimos accusamus quaerat suscipit, numquam ipsum pariatur commodi provident dolor architecto recusandae! Labore.</p>
<p>Quisquam aliquid explicabo quibusdam vero modi delectus quam. Deleniti ipsam quos aliquid dolores. Quia dolore recusandae ipsam iusto. Cumque dolor error voluptate voluptatum, facilis molestiae ratione exercitationem aspernatur vero rerum.</p>
<ul>
<li>1 Einträge bündig zum Footer</li>
<li>2 Einträge zum Footer</li>
<li>3 Einträge bündig Footer</li>
<li>4 Einträge bündig zum</li>
<li>5 Einträge bündig zum Footer Lorem</li>
<li>6 Einträge bündig zum Footer Lorem ipsum</li>
</ul>
</article>
</main>
<footer>
<h1>About this Company</h1>
<ul>
<li>1 Einträge bündig zum Hauptinhalt</li>
<li>2 Einträge zum Hauptinhalt</li>
<li>3 Einträge bündig Hauptinhalt</li>
<li>4 Einträge bündig zum</li>
<li>5 Einträge bündig zum Hauptinhalt Lorem</li>
<li>6 Einträge bündig zum Hauptinhalt Lorem ipsum</li>
</ul>
</footer>
body *, *:before, *:after {
box-sizing: border-box;
background: rgba(0,0,0, .125);
}
body {
display: -ms-grid;
display: grid;
grid-gap: 1em;
-ms-grid-columns: 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw;
grid-template-columns: repeat(12, 8vw);
}
body>header {
-ms-grid-column: 1;
-ms-grid-column-span: 12;
grid-column: 1/13;
-ms-grid-row: 1;
grid-row: 1;
}
header, nav, main, footer {
padding: 1em;
}
nav {
-ms-grid-column: 1;
-ms-grid-column-span: 4;
-ms-grid-row: 2;
grid-column: 1/5;
grid-row: 2;
}
main {
-ms-grid-column: 5;
-ms-grid-column-span: 8;
-ms-grid-row: 2;
grid-column: 5/13;
grid-row: 2;
grid-column: 5/13;
grid-row: 2;
}
body>footer{
-ms-grid-column: 1;
-ms-grid-column-span: 12;
-ms-grid-row: 3;
grid-column: 1/13;
grid-row: 3;
}
@supports (display: -ms-grid) {
footer li,
main li {
margin-right: 1em;
}
main li:nth-child(5),
main li:nth-child(6),
footer li:nth-child(5),
footer li:nth-child(6) {
margin-top: 1em;
}
}
main ul,
footer ul {
display: -ms-grid;
display: grid;
grid-gap: 1em;
list-style: none;
padding-left: 0;
}
main ul {
-ms-grid-columns: 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw;
grid-template-columns: repeat(8, 8vw);
}
footer ul {
-ms-grid-columns: 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw;
grid-template-columns: repeat(12, 8vw);
}
main li {
-ms-grid-row: 1;
}
main li:nth-child(1) {
-ms-grid-column: 1;
-ms-grid-column-span: 2;
-ms-grid-row: 1;
grid-column-start: 1;
}
main li:nth-child(2) {
-ms-grid-column-span: 2;
-ms-grid-column: 3;
}
main li:nth-child(3) {
-ms-grid-column-span: 2;
-ms-grid-column: 5;
}
main li:nth-child(4) {
-ms-grid-column-span: 2;
-ms-grid-column: 7;
}
main li:nth-child(5) {
-ms-grid-column: 1;
-ms-grid-column-span: 2;
-ms-grid-row: 2;
}
main li:nth-child(6) {
-ms-grid-column: 3;
-ms-grid-column-span: 2;
-ms-grid-row: 2;
}
footer ul {
-ms-grid-columns: 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw 8vw;
grid-template-columns: repeat(12, 8vw);
}
footer li {
-ms-grid-row: 1;
}
footer li:first-child {
-ms-grid-column: 5;
-ms-grid-column-span: 2;
grid-column-start: 5;
}
footer li:nth-child(2) {
-ms-grid-column-span: 2;
-ms-grid-column: 7;
}
footer li:nth-child(3) {
-ms-grid-column-span: 2;
-ms-grid-column: 9;
}
footer li:nth-child(4) {
-ms-grid-column-span: 2;
-ms-grid-column: 11;
}
footer li:nth-child(5) {
-ms-grid-column: 5;
-ms-grid-column-span: 2;
-ms-grid-row: 2;
}
footer li:nth-child(6) {
-ms-grid-column: 7;
-ms-grid-column-span: 2;
-ms-grid-row: 2;
}
Also see: Tab Triggers