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.
<ul class="breadcrumb">
<li class="crumb first-crumb">Home</li>
<li class="crumb middle-crumb">Articles</li>
<li class="crumb last-crumb">An Awesome Article</li>
</ul>
<div class="article">
<h3>An Awesome Article</h3>
<p>
There's a storm coming, Mr. Wayne. You and your friends better batten down the hatches, because when it hits, you're all going to wonder how you ever thought you could live so large and leave so little for the rest of us.
</p>
<p>
Now, our operation is small but there is a lot of potential for aggressive expansion. So which of you fine gentlemen would like to join our team? Oh. There's only one spot open right now, so we're gonna have... tryouts.
</p>
<p>
The first time I stole so that I wouldn't starve, yes. I lost many assumptions about the simple nature of right and wrong. And when I traveled I learned the fear before a crime and the thrill of success. But I never became one of them.
</p>
<p>
Tomorrow, you will be released. If you are bored of brawling with thieves and want to achieve something there is a rare blue flower that grows on the eastern slopes. Pick one of these flowers. If you can carry it to the top of the mountain, you may find what you were looking for in the first place.
</p>
<p>
But I know the rage that drives you. That impossible anger strangIing the grief until the memory of your loved one is just poison in your veins. And one day, you catch yourself wishing the person you loved had never existed so you'd be spared your pain.
</p>
<p>
Introduce a little anarchy, upset the established order and everything becomes chaos. I'm an agent of chaos. Oh, and you know the thing about chaos? It's fair.
</p>
<p>
When a forest grows too wild, a purging fire is inevitable and natural. Tomorrow the world will watch in horror as its greatest city destroys itself. The movement back to harmony will be unstoppable this time.
</p>
<p>
Hero can be anyone. Even a man knowing something as simple and reassuring as putting a coat around a young boy shoulders to let him know the world hadn't ended.
</p>
<p>
You wanna know how I got these scars? My father was... a drinker, and a fiend. And one night, he goes off crazier than usual. Mommy gets the kitchen knife to defend herself. He doesn't like that, not one bit. So, me watching he takes the knife to her, laughing while he does it. He turns to me and he says: "Why so serious?". He comes at me with the knife "Why so serious?". He sticks the blade in my mouth. "Let's put a smile on that face." and... Why so serious?
</p>
</div>
body {
background: #F7F7F7;
font-family: sans-serif;
}
.article {
margin: auto;
width: 80%;
background: white;
}
.article h3 {
color: #444;
padding: 10px 20px;
}
.article p {
margin: auto;
margin-bottom: 10px;
width: 90%;
}
ul.breadcrumb {
display: block;
height: 50px;
margin: auto;
list-style-type: none;
}
ul.breadcrumb > li.crumb.first-crumb {
z-index: 300;
}
ul.breadcrumb > li.crumb.middle-crumb {
z-index: 200;
}
ul.breadcrumb > li.crumb.last-crumb {
z-index: 100;
}
ul.breadcrumb > li.crumb {
position: relative;
display: inline-block;
box-sizing: border-box;
height: 0;
float: left;
color: white;
font-size: 18px;
margin-left: -14px;
padding: 5px;
padding-left: 20px;
line-height: 40px;
border-bottom: 15px solid #BADA55;
border-right: 15px solid transparent;
transition: .2s border-color linear;
}
ul.breadcrumb > li.crumb:hover,
ul.breadcrumb > li.crumb:hover:after {
cursor: pointer;
border-top-color: #CDE485;
border-bottom-color: #CDE485;
transition: .2s border-color linear;
}
li.crumb:after,
li.crumb:before {
content: '';
position: absolute;
left: 0;
transition: .2s border-color linear;
}
li.crumb:after {
width: 100%;
top: 25px;
z-index: -1;
border-top: 15px solid #bada55;
border-right: 15px solid transparent;
}
li.crumb:before {
top: 100%;
border-left: 15px solid #f7f7f7;
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
}
Also see: Tab Triggers