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="siteWrap">
<div class="flexWrap">
<header>Wonder CMS Rocks</header>
<div class="wrap">
<nav>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
<a href="#">Link 4</a>
<a href="#">Link 5</a>
</nav>
<main>
<h1>Yup Wonder CMS Still Rocks</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec nulla at tortor varius consequat. Donec sed turpis nibh. Phasellus non massa molestie nisl fringilla varius. Pellentesque in pellentesque quam, eget egestas dolor. Pellentesque varius porttitor sem eu mattis. Etiam vel semper justo, non malesuada urna. Nullam malesuada interdum purus, eget scelerisque urna consequat quis. Mauris nunc mi, varius sit amet aliquam eu, vulputate ac nulla. Fusce auctor dolor a ipsum sagittis mattis. Phasellus et blandit augue. Cras sed quam sit amet risus faucibus vulputate.</p>
<p>Vivamus consequat, velit sit amet condimentum venenatis, ante urna congue diam, non porta dui turpis vitae turpis. Fusce faucibus mollis sem. In maximus lacus vitae consectetur aliquam. Etiam mattis orci at elit volutpat lacinia. Aenean volutpat mi turpis. Vivamus tincidunt enim in urna dignissim mattis. Donec eget libero finibus, venenatis ante eget, scelerisque sapien.</p>
<p>Mauris eu nulla hendrerit, rutrum est vitae, maximus turpis. Proin elit erat, feugiat ac convallis mattis, tincidunt sed orci. Cras sodales rutrum vulputate. Morbi non sapien nunc. Proin quam ipsum, accumsan at elementum at, luctus a mi. Cras lobortis, enim sed maximus venenatis, ipsum tortor sagittis odio, dapibus tincidunt justo massa sit amet ex. Donec pharetra tortor et mi elementum pharetra. Donec tristique tortor nec elementum molestie. Maecenas facilisis tristique purus ut interdum. Suspendisse id eros maximus, lacinia neque sit amet, lacinia turpis. Nulla nisi velit, suscipit id orci ac, tincidunt finibus ante. Vivamus mattis elementum sagittis.</p>
<p>Ut quis aliquam sapien. Phasellus dictum fringilla mauris sed laoreet. Pellentesque ultricies tortor ut libero pulvinar laoreet. Aliquam et tellus augue. Nulla at felis finibus, mattis orci a, rhoncus mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut mollis et erat posuere commodo. Pellentesque ullamcorper at nisi et viverra. Nam vel vestibulum nulla. Phasellus odio est, ultrices nec arcu sed, molestie rhoncus nisi. Ut vel gravida ipsum, nec mattis nisi.</p>
<p>Cras aliquet leo id est imperdiet pulvinar. Suspendisse fringilla nisl porttitor, faucibus dui sed, dictum ligula. Vestibulum eu massa ut velit finibus venenatis. Ut a elit ac nunc sodales convallis. Nullam sit amet risus dui. Proin tortor dui, euismod at ultrices id, consectetur vel libero. In hac habitasse platea dictumst. Quisque facilisis sit amet nunc eget auctor. Proin lorem odio, condimentum ut placerat eu, imperdiet eu dui. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In tempor dolor vel purus sagittis cursus.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec nulla at tortor varius consequat. Donec sed turpis nibh. Phasellus non massa molestie nisl fringilla varius. Pellentesque in pellentesque quam, eget egestas dolor. Pellentesque varius porttitor sem eu mattis. Etiam vel semper justo, non malesuada urna. Nullam malesuada interdum purus, eget scelerisque urna consequat quis. Mauris nunc mi, varius sit amet aliquam eu, vulputate ac nulla. Fusce auctor dolor a ipsum sagittis mattis. Phasellus et blandit augue. Cras sed quam sit amet risus faucibus vulputate.</p>
<p>Vivamus consequat, velit sit amet condimentum venenatis, ante urna congue diam, non porta dui turpis vitae turpis. Fusce faucibus mollis sem. In maximus lacus vitae consectetur aliquam. Etiam mattis orci at elit volutpat lacinia. Aenean volutpat mi turpis. Vivamus tincidunt enim in urna dignissim mattis. Donec eget libero finibus, venenatis ante eget, scelerisque sapien.</p>
<p>Mauris eu nulla hendrerit, rutrum est vitae, maximus turpis. Proin elit erat, feugiat ac convallis mattis, tincidunt sed orci. Cras sodales rutrum vulputate. Morbi non sapien nunc. Proin quam ipsum, accumsan at elementum at, luctus a mi. Cras lobortis, enim sed maximus venenatis, ipsum tortor sagittis odio, dapibus tincidunt justo massa sit amet ex. Donec pharetra tortor et mi elementum pharetra. Donec tristique tortor nec elementum molestie. Maecenas facilisis tristique purus ut interdum. Suspendisse id eros maximus, lacinia neque sit amet, lacinia turpis. Nulla nisi velit, suscipit id orci ac, tincidunt finibus ante. Vivamus mattis elementum sagittis.</p>
<p>Ut quis aliquam sapien. Phasellus dictum fringilla mauris sed laoreet. Pellentesque ultricies tortor ut libero pulvinar laoreet. Aliquam et tellus augue. Nulla at felis finibus, mattis orci a, rhoncus mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut mollis et erat posuere commodo. Pellentesque ullamcorper at nisi et viverra. Nam vel vestibulum nulla. Phasellus odio est, ultrices nec arcu sed, molestie rhoncus nisi. Ut vel gravida ipsum, nec mattis nisi.</p>
<p>Cras aliquet leo id est imperdiet pulvinar. Suspendisse fringilla nisl porttitor, faucibus dui sed, dictum ligula. Vestibulum eu massa ut velit finibus venenatis. Ut a elit ac nunc sodales convallis. Nullam sit amet risus dui. Proin tortor dui, euismod at ultrices id, consectetur vel libero. In hac habitasse platea dictumst. Quisque facilisis sit amet nunc eget auctor. Proin lorem odio, condimentum ut placerat eu, imperdiet eu dui. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In tempor dolor vel purus sagittis cursus.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec nulla at tortor varius consequat. Donec sed turpis nibh. Phasellus non massa molestie nisl fringilla varius. Pellentesque in pellentesque quam, eget egestas dolor. Pellentesque varius porttitor sem eu mattis. Etiam vel semper justo, non malesuada urna. Nullam malesuada interdum purus, eget scelerisque urna consequat quis. Mauris nunc mi, varius sit amet aliquam eu, vulputate ac nulla. Fusce auctor dolor a ipsum sagittis mattis. Phasellus et blandit augue. Cras sed quam sit amet risus faucibus vulputate.</p>
<p>Vivamus consequat, velit sit amet condimentum venenatis, ante urna congue diam, non porta dui turpis vitae turpis. Fusce faucibus mollis sem. In maximus lacus vitae consectetur aliquam. Etiam mattis orci at elit volutpat lacinia. Aenean volutpat mi turpis. Vivamus tincidunt enim in urna dignissim mattis. Donec eget libero finibus, venenatis ante eget, scelerisque sapien.</p>
<p>Mauris eu nulla hendrerit, rutrum est vitae, maximus turpis. Proin elit erat, feugiat ac convallis mattis, tincidunt sed orci. Cras sodales rutrum vulputate. Morbi non sapien nunc. Proin quam ipsum, accumsan at elementum at, luctus a mi. Cras lobortis, enim sed maximus venenatis, ipsum tortor sagittis odio, dapibus tincidunt justo massa sit amet ex. Donec pharetra tortor et mi elementum pharetra. Donec tristique tortor nec elementum molestie. Maecenas facilisis tristique purus ut interdum. Suspendisse id eros maximus, lacinia neque sit amet, lacinia turpis. Nulla nisi velit, suscipit id orci ac, tincidunt finibus ante. Vivamus mattis elementum sagittis.</p>
<p>Ut quis aliquam sapien. Phasellus dictum fringilla mauris sed laoreet. Pellentesque ultricies tortor ut libero pulvinar laoreet. Aliquam et tellus augue. Nulla at felis finibus, mattis orci a, rhoncus mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut mollis et erat posuere commodo. Pellentesque ullamcorper at nisi et viverra. Nam vel vestibulum nulla. Phasellus odio est, ultrices nec arcu sed, molestie rhoncus nisi. Ut vel gravida ipsum, nec mattis nisi.</p>
<p>Cras aliquet leo id est imperdiet pulvinar. Suspendisse fringilla nisl porttitor, faucibus dui sed, dictum ligula. Vestibulum eu massa ut velit finibus venenatis. Ut a elit ac nunc sodales convallis. Nullam sit amet risus dui. Proin tortor dui, euismod at ultrices id, consectetur vel libero. In hac habitasse platea dictumst. Quisque facilisis sit amet nunc eget auctor. Proin lorem odio, condimentum ut placerat eu, imperdiet eu dui. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In tempor dolor vel purus sagittis cursus.</p>
</main>
</div>
<footer>
<div class="top">
<a href="#">Info Link 1</a>
<a href="#">Info Link 2</a>
<a href="#">Info Link 3</a>
</div>
<div class="bottom">
<p>A tiny bit of text which you could use as a credit or something</p>
</div>
</footer>
</div>
</div>
/* Modern CSS Reset */
/*https://github.com/elad2412/the-new-css-reset*/
*:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) {
all: unset;
display: revert;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
ol,
ul {
list-style: none;
}
img {
max-width: 100%;
}
table {
border-collapse: collapse;
}
textarea {
white-space: revert;
}
/* Text */
:root {
--darkBlue: #00406a;
}
h1 {
text-align: center;
font-size: 4rem;
margin-top: 3rem;
color: var(--darkBlue);
}
/* Structure */
html {
font: 10px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
background: #00416a; /* fallback for old browsers */
background: -webkit-linear-gradient(
to top,
#e4e5e6,
#00416a
); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(
to top,
#e4e5e6,
#00416a
); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
body {
}
.siteWrap {
display: flex;
flex-flow: column nowrap;
justify-content: flex-start;
align-items: center;
}
.siteWrap .flexWrap {
max-width: 120rem;
}
.siteWrap .flexWrap .wrap {
margin-right: 2rem;
margin-left: 2rem;
display: flex;
flex-flow: row nowrap;
justify-content: flex-start;
align-items: flex-start;
}
/*Core Sections*/
nav {
background-color: var(--darkBlue);
min-width: 27rem;
margin-right: 2.5rem;
align-self: stretch;
display: flex;
flex-flow: column nowrap;
justify-content: space-around;
align-items: center;
align-content: center;
padding-top: 1rem;
height: calc(100vh - 1rem);
position: sticky;
top: 0;
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.11);
}
header {
height: 20rem;
background-color: var(--darkBlue);
margin: 2rem;
display: flex;
flex-flow: row nowrap;
justify-content: space-around;
align-items: center;
align-content: center;
color: white;
font-weight: bold;
font-size: 5rem;
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.11);
}
main {
background-color: white;
border-radius: 10px;
border-style: var(--darkBlue);
}
footer {
background-color: var(--darkBlue);
height: 10rem;
margin: 2rem;
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.11);
display: flex;
flex-flow: column nowrap;
justify-content: flex-start;
align-items: flex-start;
padding: 1rem;
}
/* Content */
main p {
font-size: 1.8rem;
margin: 2.5rem 2rem 2.5rem;
line-height: 3rem;
}
/* Nav */
nav a {
background-color: white;
display: block;
width: calc(100% - 2rem);
height: 100%;
margin-bottom: 1rem;
display: flex;
flex-flow: row nowrap;
justify-content: space-around;
align-items: center;
align-content: center;
font-weight: bold;
text-decoration: none;
font-size: 4rem;
box-shadow: 0 0 5px black;
border-radius: 10px;
}
/* Footer */
footer > div {
width: 100%;
}
footer .top {
flex: 1;
display: flex;
flex-flow: row nowrap;
justify-content: space-around;
align-items: center;
align-content: center;
margin-bottom: 1rem;
}
footer .top a {
display: block;
flex: 1;
align-self: stretch;
background-color: white;
display: flex;
flex-flow: row nowrap;
justify-content: center;
align-items: center;
}
footer .top a:first-child {
border-radius: 1rem 0 0 0;
margin-right: 2rem;
}
footer .top a:last-child {
border-radius: 0 1rem 0 0;
margin-left: 2rem;
}
footer .bottom {
text-align: center;
color: white;
font-size: 1.2rem;
background-color: white;
padding: .5rem;
}
footer .bottom p {
color: black;
}
/* Mobile */
@media only screen and (max-width: 1000px) {
html {
font-size: 8px;
}
}
@media only screen and (max-width: 800px) {
html {
font-size: 6px;
}
}
Also see: Tab Triggers