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="container-fixed">
<header class="sticky-header">
<h1>Title of the Application</h1>
</header>
<aside class="sticky-menu">
<ol>
<li>Menu Item 1</li>
<li>Menu Item 2</li>
<li>Menu Item 3</li>
<li>Menu Item 4</li>
<li>Menu Item 5</li>
</ol>
</aside>
<main class="main-content">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec egestas, augue quis eleifend fermentum, purus ligula varius dui, nec dapibus dui urna et massa. Nam faucibus est id ex bibendum blandit. Nam ac lacus tincidunt, facilisis nulla quis, condimentum magna. Duis a elementum enim. Vestibulum pulvinar mi at mollis semper. Proin condimentum libero quam, sed congue nulla sagittis in. Ut vehicula molestie luctus. Nullam pellentesque, mauris placerat commodo lobortis, ex nibh venenatis mi, non hendrerit nunc neque pulvinar erat.
</p>
<p>
Cras vel ullamcorper mauris. Fusce condimentum, lacus vel gravida sollicitudin, enim tellus tristique est, tempus tempus diam dui at ex. Aliquam fermentum aliquet dignissim. Proin pretium dapibus molestie. Curabitur vitae blandit tortor. Ut viverra mollis nunc, vitae placerat est volutpat ac. Pellentesque pulvinar enim iaculis lectus feugiat, sodales tempor metus cursus. Morbi id faucibus massa. Aliquam mi ipsum, gravida vel libero vel, egestas dignissim mauris.
</p>
<p>
Sed tincidunt nunc at dolor malesuada, vel congue arcu consequat. Aliquam faucibus malesuada pellentesque. Phasellus varius nisi odio, at laoreet dui vestibulum eget. In massa ex, dictum et vulputate id, tristique eu nulla. Donec in orci eget eros ultrices gravida. Praesent at viverra augue. In at mattis lorem. Donec gravida est id nisl cursus rhoncus. Duis iaculis eget augue vel fringilla. Sed fermentum fermentum ante nec blandit. Vestibulum in enim rutrum magna sollicitudin elementum. Mauris elementum purus vitae est vulputate, id pharetra nibh lobortis. Sed aliquam auctor neque. Praesent quis ipsum sed augue ultricies ultricies non at justo. Aenean ac neque vulputate, suscipit felis et, cursus tortor.
</p>
<p>
Morbi faucibus dictum ligula, ut auctor leo malesuada id. Nunc maximus, lectus a molestie condimentum, sem lacus condimentum purus, sit amet finibus nunc elit et purus. Morbi rhoncus euismod risus sed dictum. Nulla eu suscipit lectus. Donec eros diam, bibendum sit amet turpis eu, malesuada eleifend quam. Praesent pharetra commodo est et volutpat. Maecenas semper, purus eu cursus pharetra, eros eros facilisis nibh, in varius eros augue ut metus.
</p>
<p>
In erat quam, condimentum quis posuere et, porta vel odio. Morbi interdum facilisis augue, eget mattis lectus sodales quis. Maecenas non sapien magna. Aliquam sit amet gravida odio, non porttitor orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec a quam eu nulla vehicula rutrum eget ac augue. Duis pharetra arcu sem, eu pharetra velit sodales et. Integer rhoncus pharetra massa, id gravida elit dictum eget. Vestibulum id dapibus augue, nec faucibus purus. Aenean egestas dolor at risus sodales, nec sagittis magna iaculis. Curabitur ornare felis vitae odio dapibus, semper accumsan massa pulvinar.
</p>
<p>
Fusce vitae justo ac nisi ornare pharetra. Sed sed rutrum diam, rutrum eleifend eros. Phasellus congue luctus efficitur. Morbi a elit nibh. Fusce laoreet felis ultricies, suscipit nisl vel, dignissim elit. Proin dictum cursus lectus, sit amet eleifend lectus tincidunt vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</p>
<p>
In vitae enim sed erat mollis volutpat. Phasellus pulvinar ac felis at pulvinar. In eros dolor, vehicula vitae neque sed, mollis convallis libero. Sed vitae magna ligula. Vivamus consequat sapien a sodales blandit. Nunc vitae lacus a erat sodales congue quis nec neque. Maecenas quis tincidunt dolor. Duis in cursus nisi. Donec consectetur lacus metus, quis ornare diam tristique a. Donec feugiat, tortor at rhoncus aliquam, nibh risus euismod odio, eu eleifend nisl purus ac arcu. Vestibulum eget tempus turpis. Quisque eget arcu vitae arcu porttitor egestas id maximus velit.
</p>
<p>
Pellentesque luctus, turpis quis sodales blandit, orci turpis vestibulum leo, quis auctor libero magna a dui. Nam eu placerat elit, sit amet fermentum velit. Aenean feugiat sapien sit amet velit rhoncus, et luctus libero vestibulum. Praesent est lectus, vestibulum sit amet urna et, sodales laoreet purus. Nullam sit amet purus eu lacus molestie consectetur aliquam quis augue. Suspendisse potenti. Curabitur consectetur purus metus, id iaculis mi cursus lacinia. Pellentesque elementum neque ut nisl efficitur imperdiet.
</p>
<p>
Nullam sed tincidunt mauris. Etiam non porttitor ex, placerat lacinia ligula. Duis nisl risus, tempus nec aliquet a, vestibulum quis lacus. Proin porttitor, felis eget fringilla pellentesque, dolor orci finibus quam, ut accumsan massa urna eu nisl. Nulla euismod nisi id diam congue, nec iaculis neque suscipit. Nunc molestie mollis auctor. Phasellus maximus et metus quis rhoncus. Aliquam volutpat ipsum ut lectus ornare posuere.
</p>
<p>
Nulla pharetra nibh a mauris egestas fringilla. Aenean tincidunt dui mauris, vitae blandit neque dignissim eu. Mauris eget enim eget purus molestie egestas eget a felis. Curabitur in elit at justo euismod rhoncus faucibus nec nunc. Etiam odio metus, pretium vel magna non, mollis imperdiet sapien. Suspendisse ante lorem, congue vehicula elementum maximus, fringilla at libero. Mauris molestie porttitor dapibus. Vestibulum id faucibus risus. Vivamus eget libero vitae felis varius rhoncus. Fusce euismod, turpis nec rhoncus sollicitudin, mauris augue maximus augue, eu cursus ex velit ac libero. Maecenas vel nibh sed enim consequat imperdiet vel vel libero. Quisque in ullamcorper leo. Aenean tempus sem et nisi consequat, eu consequat velit malesuada. Nunc non sem finibus, aliquam turpis non, congue lacus.
</p>
<p>
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam quis nisi eget lectus tincidunt elementum ac vitae odio. Vestibulum justo augue, rutrum sit amet luctus et, tincidunt sed orci. Curabitur nec tincidunt mi. Proin nulla odio, efficitur nec ipsum vitae, tempus viverra metus. Aliquam in diam lacinia nunc lobortis euismod. Cras aliquam ullamcorper ipsum, non molestie nulla semper at. Nam vehicula dui sit amet elit ultrices, vitae consectetur enim efficitur.
</p>
<p>
Proin molestie sollicitudin quam, vel varius ipsum tempor sit amet. Nam id nulla vitae lorem sollicitudin laoreet eget sed erat. Maecenas porttitor aliquet varius. Donec massa augue, mattis dictum efficitur quis, molestie id augue. Aliquam eget hendrerit urna. Vivamus egestas interdum mi, quis tincidunt nunc tempor eget. Donec porta volutpat nibh vel gravida. Praesent porttitor ligula at dui eleifend, at lacinia arcu sollicitudin. Nulla rutrum magna sapien, nec viverra nunc lacinia eu. Pellentesque aliquet luctus eleifend. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam sit amet pellentesque quam. Vestibulum a justo eros. Maecenas aliquam euismod lacinia. Duis malesuada nunc eget venenatis tempus. In vel purus mi.
</p>
<p>
Donec sed gravida metus. Nullam ut auctor massa. Maecenas feugiat nibh non interdum blandit. Proin ultrices nec sapien sed dignissim. Morbi sit amet elit et massa malesuada luctus. In posuere nec ipsum at porta. Praesent congue tincidunt purus et condimentum. Integer vitae faucibus ex. Suspendisse commodo ipsum in fringilla fringilla.
</p>
<p>
Nulla euismod massa non odio tincidunt, eget mollis quam tristique. Donec fringilla, mauris porta malesuada varius, neque nibh hendrerit diam, convallis mattis turpis arcu ut diam. Maecenas mattis orci ut erat fermentum dapibus. Nunc in fringilla ex. Integer sollicitudin eleifend velit. Etiam sapien enim, tempus pharetra mi id, congue venenatis erat. Phasellus lectus ligula, sollicitudin dapibus est et, vehicula suscipit arcu. In laoreet laoreet laoreet.
</p>
<p>
Pellentesque non ullamcorper nisi. Nulla luctus venenatis felis, nec ultrices neque blandit non. Nulla consequat at enim quis ultrices. Morbi non nulla ac justo lacinia efficitur non vitae est. Nullam molestie efficitur congue. Phasellus nec neque nunc. Suspendisse tincidunt bibendum nibh quis malesuada. Fusce diam mauris, euismod ac nisi posuere, rhoncus fermentum orci. Mauris porta, nisl sit amet gravida tristique, urna ex laoreet est, vitae pharetra turpis lorem et nunc. Nulla facilisi. Curabitur vulputate sollicitudin diam sit amet dapibus.
</p>
</main>
</div>
body
{
font-family: Calibri, Helvetica, Segoe U, Arial, sans-serif;
}
.container-fluid
{
width: auto;
margin-left: 64px;
margin-right: 64px;
}
.container-fixed
{
width: 1024px;
margin-left: auto;
margin-right: auto;
}
header
{
text-align: center;
border-bottom: 1px solid #cccccc;
margin-bottom: 40px;
}
.sticky-header
{
position: sticky;
top: 0px;
z-index: 10000; /* Need this so the speech list (relative position) scrolls behind. */
background-color: white;
}
.sticky-menu
{
position: sticky;
top: 120px;
width: 150px;
border: 1px dotted #cccccc;
float: left;
}
.main-content
{
padding-left: 200px;
}
Also see: Tab Triggers