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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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="gridcontainer">
<div class="griditem1">
<h2 id="responsive_headline">FLUID TYPE</h2>
<hr>
<h3 class="subtitle">It's pretty satisfying.</h3>
</div>
<p class="griditem2 aside">Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading.</p>
<div class="griditem3 aside">
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.</p>
</div>
<div class="griditem4">
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading. This can comfortably contain a three hundred pixel wide advertising unit.
Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.</p>
<p>Asymmetric grids can give rise to interesting layouts due to combining and offsetting columns.</p>
<hr>
</div>
<div class="griditem5">
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading.</p>
</div>
<div class="griditem6">
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading. This can comfortably contain a three hundred pixel wide advertising unit.
</p>
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.
</p>
</div>
<div class="griditem7 aside">
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide.</p>
</div>
<div class="griditem8">
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.
Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading. This can comfortably contain a three hundred pixel wide advertising unit.
</p>
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.
Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading. This can comfortably contain a three hundred pixel wide advertising unit.
</p>
</div>
<div class="griditem9 aside">
<p>This specimen sheet is designed around an asymmetric five column grid. The first and last columns are two hundred pixels wide.
</p>
</div>
</div>
html {
--font-size-sm: clamp(0.8rem, 0.17vw + 0.76rem, 0.89rem);
--font-size-base: clamp(1rem, 0.34vw + 0.91rem, 1.19rem);
--font-size-md: clamp(1.25rem, 0.61vw + 1.1rem, 1.58rem);
--font-size-lg: clamp(1.56rem, 1vw + 1.31rem, 2.11rem);
--font-size-xl: clamp(1.95rem, 1.56vw + 1.56rem, 2.81rem);
--font-size-xxl: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
--font-size-xxxl: clamp(3.05rem, 3.54vw + 2.17rem, 5rem);
font-family: "EB Garamond", serif;
line-height: 1.5;
font-size: var(--font-size-base);
}
body {
margin: 0;
padding: 0;
background-color: #faf8f6;
}
.gridcontainer {
display: grid;
margin: auto;
max-width: 1200px;
margin: 0 auto;
padding-left: 4%;
padding-right: 4%;
justify-content: center;
grid-template-rows: auto;
grid-template-columns: 25% repeat(3, 1fr 12.5925%) 1fr 25%;
}
@media (max-width: 670px) {
.gridcontainer {
grid-template-columns: 100%;
}
[class*="griditem"] {
grid-column: 1 / -1 !important;
}
}
.griditem1 {
grid-column: 2 / 9;
margin: 0 auto;
padding: 0;
width: 100%;
text-align: right;
}
@media (max-width: 670px) {
.griditem1 {
grid-template-columns: 1 / 3;
}
}
h2 {
margin: 0;
font-family: system-ui;
font-weight: 900;
font-size: var(--font-size-xxl);
}
hr {
margin: 0;
padding: 0;
}
.subtitle {
font-size: var(--font-size-md);
margin-top: 20px;
margin-bottom: 20px;
font-style: italic;
font-weight: 400;
}
.griditem2 {
grid-column: 1 / 2;
}
.griditem3 {
grid-column: 9;
}
.griditem2 p,
.griditem3 p {
text-align: justify;
}
.griditem4 {
grid-column: 3 / 8;
grid-row: 2;
}
.griditem5 {
grid-column: 1 / -1;
background-color: black;
color: white;
margin-top: 20px;
margin-bottom: 20px;
padding: 1rem;
}
p {
max-width: 70ch;
}
.griditem5 p {
margin: auto;
padding-top: 3%;
padding-bottom: 3%;
}
.griditem6 {
grid-column: 1 / 8;
}
.griditem7 {
grid-column: 9;
}
.griditem7 p {
background-color: rgb(225, 224, 222);
padding: 5px 15px 10px 15px;
}
.aside,
.aside p {
color: #cd2f27;
font-size: var(--font-size-sm);
text-align: justify;
}
.griditem8 {
grid-column: 3 / -1;
}
.griditem8 p {
margin: 0;
}
.griditem9 {
grid-column: 1;
text-align: right;
grid-row: 5;
}
.griditem9 p {
border-right: 1px solid gray;
padding-right: 10px;
text-align: right;
}
p + p {
margin-top: 0;
text-indent: 2em;
}
p {
font-size: var(--font-size-base);
}
Also see: Tab Triggers