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.
<main class="fixed">
<nav class="fixed__nav">
<ul>
<li>Home</li>
<li>About me</li>
<li>Information</li>
<li>Contact me</li>
</ul>
</nav>
<section>
<p class="fixed__text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue
tortor eget pulvinar lobortis. Vestibulum ante ipsum primis in
faucibus orci luctus et ultrices posuere cubilia Curae; Nam ac dolor
augue. Pellentesque mi mi, laoreet et dolor sit amet, ultrices varius
risus. Nam vitae iaculis elit. Aliquam mollis interdum libero. Sed
sodales placerat egestas. Vestibulum ut arcu aliquam purus viverra
dictum vel sit amet mi. Duis nisl mauris, aliquam sit amet luctus
eget, dapibus in enim. Sed velit augue, pretium a sem aliquam, congue
porttitor tortor. Sed tempor nisl a lorem consequat, id maximus erat
aliquet. Sed sagittis porta libero sed condimentum. Aliquam finibus
lectus nec ante congue rutrum. Curabitur quam quam, accumsan id
ultrices ultrices, tempor et tellus. Lorem ipsum dolor sit amet
consectetur adipisicing elit. Accusamus velit animi libero nemo?
Reprehenderit numquam corporis eos sapiente magni accusantium, non
explicabo eaque rerum, reiciendis, iste accusamus veritatis deserunt
est!
</p>
<p class="fixed__text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue
tortor eget pulvinar lobortis. Vestibulum ante ipsum primis in
faucibus orci luctus et ultrices posuere cubilia Curae; Nam ac dolor
augue. Pellentesque mi mi, laoreet et dolor sit amet, ultrices varius
risus. Nam vitae iaculis elit. Aliquam mollis interdum libero. Sed
sodales placerat egestas. Vestibulum ut arcu aliquam purus viverra
dictum vel sit amet mi. Duis nisl mauris, aliquam sit amet luctus
eget, dapibus in enim. Sed velit augue, pretium a sem aliquam, congue
porttitor tortor. Sed tempor nisl a lorem consequat, id maximus erat
aliquet. Sed sagittis porta libero sed condimentum. Aliquam finibus
lectus nec ante congue rutrum. Curabitur quam quam, accumsan id
ultrices ultrices, tempor et tellus. Lorem ipsum dolor sit amet
consectetur adipisicing elit. Et dignissimos quo tempore labore
repudiandae aliquid beatae quos consequuntur earum illo ipsa ipsum
praesentium necessitatibus dolores, minus odit hic quia qui.
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Sequi
laudantium quisquam voluptate perferendis accusantium, beatae unde
atque tempora. Distinctio libero cum nam. Dolores iste non deleniti
aperiam modi, dolor vitae.lore Lorem ipsum dolor sit amet consectetur
adipisicing elit. Nemo, quisquam quaerat dolores dignissimos voluptate
harum enim est reprehenderit aliquid, tenetur animi perspiciatis?
Assumenda excepturi reprehenderit officia numquam, quo dolorem. Ea.
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Totam
similique cum aliquid eaque facilis quisquam accusantium, est odit
praesentium eligendi recusandae. Perferendis quisquam ullam autem
accusantium iure vitae eligendi dolore!
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Atque nobis
tenetur ratione nulla nesciunt et perspiciatis distinctio ipsum
itaque? Sunt magni ipsam quos a voluptates illum facilis totam et non.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo cum a
aspernatur nulla id eius molestiae, odit consequatur enim, officiis
voluptatibus ducimus voluptates culpa magnam, aut tenetur quam! Non,
animi! Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Incidunt blanditiis, porro sequi laudantium fugit nihil facilis
recusandae ipsam rem tenetur dolorum cupiditate obcaecati doloremque
consequatur. Adipisci inventore aliquam quasi quisquam?
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Odio
perferendis dignissimos tempora enim totam quam atque sequi excepturi
maxime architecto quas aut consequuntur, vel, ex quaerat magni iste
officia! Non! Lorem ipsum dolor sit amet consectetur adipisicing elit.
Cupiditate omnis et perferendis vero eum pariatur amet esse sunt ab,
vel minus eligendi eaque eos praesentium assumenda earum placeat
officia porro!
</p>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Hic maiores
dolor excepturi! Dicta, perferendis odio. Ex voluptate officia
laboriosam soluta laborum vero ullam impedit perferendis veritatis
corrupti autem, earum sint. Lorem ipsum dolor sit amet consectetur,
adipisicing elit. Ab culpa eum, ut fugit odit asperiores minus,
pariatur molestiae placeat, omnis nam. Ipsa corporis cum pariatur,
possimus reiciendis alias quis nemo!
</p>
</section>
</main>
body{
padding: 0;
margin: 0;
box-sizing: 0;
}
nav{
top: 0px;
height: 50px;
display: flex;
justify-content: center;
position: fixed;
width: 100%;
background-color: cornflowerblue;
}
ul{
list-style:none;
gap:30px;
display: flex;
}
section{
position: relative;
top: 55px;
width: 500px;
margin: auto;
text-align: justify;
}
Also see: Tab Triggers