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.
<header>
<div class="background"></div>
<div class="background"></div>
<div class="background"></div>
<div class="background"></div>
<div class="background"></div>
<div class="content">
<svg class="logo" width="100%" height="100%" viewBox="0 0 157 73" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="M147.669,18.763C146.012,18.763 144.469,18.343 143.038,17.503C141.631,16.641 140.507,15.494 139.667,14.064C138.827,12.634 138.407,11.079 138.407,9.399C138.407,7.696 138.827,6.13 139.667,4.699C140.507,3.269 141.642,2.134 143.072,1.294C144.503,0.431 146.058,0 147.738,0C149.418,0 150.961,0.431 152.369,1.294C153.799,2.134 154.923,3.269 155.74,4.699C156.58,6.13 157,7.696 157,9.399C157,11.079 156.58,12.645 155.74,14.098C154.923,15.528 153.799,16.663 152.369,17.503C150.939,18.343 149.372,18.763 147.669,18.763ZM147.772,16.822C149.088,16.822 150.292,16.493 151.381,15.835C152.494,15.176 153.368,14.28 154.003,13.144C154.662,12.009 154.991,10.761 154.991,9.399C154.991,8.014 154.662,6.754 154.003,5.619C153.368,4.484 152.494,3.587 151.381,2.929C150.269,2.27 149.054,1.941 147.738,1.941C146.398,1.941 145.172,2.27 144.06,2.929C142.947,3.587 142.062,4.484 141.404,5.619C140.745,6.754 140.416,8.014 140.416,9.399C140.416,10.761 140.734,12.009 141.37,13.144C142.028,14.28 142.913,15.176 144.026,15.835C145.161,16.493 146.41,16.822 147.772,16.822ZM144.264,14.37L144.264,4.359L148.248,4.359C149.361,4.359 150.223,4.608 150.836,5.108C151.472,5.607 151.79,6.288 151.79,7.151C151.79,7.719 151.631,8.218 151.313,8.649C150.995,9.081 150.564,9.399 150.019,9.603C150.519,9.762 150.904,10.023 151.177,10.386C151.449,10.749 151.586,11.249 151.586,11.884L151.586,14.37L149.61,14.37L149.61,12.089C149.61,11.499 149.486,11.079 149.236,10.829C148.986,10.556 148.543,10.42 147.908,10.42L146.205,10.42L146.205,14.37L144.264,14.37ZM148.112,8.752C148.68,8.752 149.111,8.638 149.406,8.411C149.701,8.184 149.849,7.832 149.849,7.355C149.849,6.924 149.701,6.606 149.406,6.402C149.134,6.198 148.702,6.095 148.112,6.095L146.205,6.095L146.205,8.752L148.112,8.752Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M111.15,36.102L136.525,0.638L123.297,0.638C123.297,0.638 105.93,26.765 104.671,28.478C104.401,28.135 86.134,0.638 86.134,0.638L72.457,0.638L97.922,36.187L70.027,72.593L83.345,72.593C83.345,72.593 104.221,44.154 104.401,43.897C104.581,44.239 125.367,72.593 125.367,72.593L139.134,72.593L111.15,36.102Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M49.941,0.639L36.443,0.639L58.669,31.648L0,31.648L0,41.413L57.859,41.413L34.014,72.593L47.511,72.593L75.406,36.188L49.941,0.639Z" style="fill:white;fill-rule:nonzero;"/>
</svg>
</div>
</header>
</body>
<main>
<h1>What Is A Blur Gradient?</h1>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quos ex ducimus rerum recusandae ratione, modi error enim iste tenetur provident quisquam placeat perspiciatis architecto sint, qui quod dolor blanditiis. Cumque!</p>
<h2>This Could Be The Next Big Thing</h2>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Expedita optio eaque doloribus, mollitia praesentium, quidem quas et in nobis rerum dolor veniam unde asperiores officia impedit eveniet, voluptates odit sapiente necessitatibus sint? Temporibus voluptate ad eos, sunt sapiente laborum. Provident dolores mollitia neque non qui, similique, suscipit quam culpa, unde nam id temporibus fugit ab. Alias consequatur illum iste, cumque maiores debitis similique voluptatem labore autem sunt asperiores tempore aliquid, vitae totam rerum, architecto in doloribus nam odit minus quam! Autem officia aliquid obcaecati assumenda praesentium ex, facilis, in ratione repellendus voluptatibus odit quo expedita enim quidem illo veniam? Alias architecto exercitationem neque reiciendis cum, rem rerum tempora quae veritatis soluta voluptates minus saepe? Quo sint quibusdam nam temporibus suscipit.</p>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi totam provident optio sint corporis qui ad expedita ducimus voluptates! Aspernatur esse sapiente quas, consequuntur id illum ex quidem perferendis totam. Ea deleniti quibusdam adipisci iste, aut commodi, error doloribus autem repudiandae nisi quis totam dolor sit placeat optio et eveniet!</p>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsum sequi recusandae consequuntur similique! Harum, assumenda. Unde molestias cupiditate, possimus necessitatibus sapiente error quibusdam excepturi voluptate, iusto natus nam. Consequatur, dolorem necessitatibus iusto fugit accusantium autem dolores perferendis commodi modi ab. Fugit eos error, dolor et exercitationem velit adipisci, sunt repellendus, dolorem vitae blanditiis placeat possimus doloremque accusamus! Numquam nulla alias facere, a nobis repudiandae! Minus rem enim asperiores consectetur corrupti ratione fugiat autem! Vitae tempore eum reiciendis aut incidunt cupiditate corrupti! Perspiciatis voluptatum excepturi autem assumenda totam sequi repellat! Beatae est amet, impedit blanditiis dignissimos ut quod ipsum molestiae nisi.</p>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quos ex ducimus rerum recusandae ratione, modi error enim iste tenetur provident quisquam placeat perspiciatis architecto sint, qui quod dolor blanditiis. Cumque!V</p>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi totam provident optio sint corporis qui ad expedita ducimus voluptates! Aspernatur esse sapiente quas, consequuntur id illum ex quidem perferendis totam. Ea deleniti quibusdam adipisci iste, aut commodi, error doloribus autem repudiandae nisi quis totam dolor sit placeat optio et eveniet!</p>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsum sequi recusandae consequuntur similique! Harum, assumenda. Unde molestias cupiditate, possimus necessitatibus sapiente error quibusdam excepturi voluptate, iusto natus nam. Consequatur, dolorem necessitatibus iusto fugit accusantium autem dolores perferendis commodi modi ab. Fugit eos error, dolor et exercitationem velit adipisci, sunt repellendus, dolorem vitae blanditiis placeat possimus doloremque accusamus! Numquam nulla alias facere, a nobis repudiandae! Minus rem enim asperiores consectetur corrupti ratione fugiat autem! Vitae tempore eum reiciendis aut incidunt cupiditate corrupti! Perspiciatis voluptatum excepturi autem assumenda totam sequi repellat! Beatae est amet, impedit blanditiis dignissimos ut quod ipsum molestiae nisi.</p>
<h2>Try It Out!</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsum sequi recusandae consequuntur similique! Harum, assumenda. Unde molestias cupiditate, possimus necessitatibus sapiente error quibusdam excepturi voluptate, iusto natus nam. Consequatur, dolorem necessitatibus iusto fugit accusantium autem dolores perferendis commodi modi ab. Fugit eos error, dolor et exercitationem velit adipisci, sunt repellendus, dolorem vitae blanditiis placeat possimus doloremque accusamus! Numquam nulla alias facere, a nobis repudiandae! Minus rem enim asperiores consectetur corrupti ratione fugiat autem! Vitae tempore eum reiciendis aut incidunt cupiditate corrupti! Perspiciatis voluptatum excepturi autem assumenda totam sequi repellat! Beatae est amet, impedit blanditiis dignissimos ut quod ipsum molestiae nisi.</p>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quos ex ducimus rerum recusandae ratione, modi error enim iste tenetur provident quisquam placeat perspiciatis architecto sint, qui quod dolor blanditiis. Cumque!V</p>
</main>
*,
*::before,
*::after {
box-sizing: border-box;
}
:root {
--header-height: 8rem;
}
body {
background-color: black;
font-family: "system-ui", sans-serif;
color: white;
margin: 0;
}
header {
height: var(--header-height);
position: fixed;
top: 0;
left: 0;
right: 0;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, .2), transparent);
}
header .background {
--gradient-height: 4rem;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
$layerCount: 5;
@for $i from 1 through $layerCount {
&:nth-child(#{$i}) {
backdrop-filter: blur(#{$i * .5}px);
mask-image: linear-gradient(
to bottom,
black calc(100% - var(--gradient-height) / #{$layerCount} * #{$i}),
transparent calc(100% - var(--gradient-height) / #{$layerCount} * #{$i - 1})
);
}
}
}
header .content {
height: 70%;
display: flex;
justify-content: start;
align-items: center;
padding: 0 2rem;
}
header .content {
height: 80%;
}
header .logo {
height: 2rem;
width: auto;
}
main {
padding: 0 2rem;
padding-bottom: 4rem;
margin-top: var(--header-height);
font-size: .875rem;
line-height: 1.5;
column-count: 2;
gap: 2rem;
}
// Nothing to see here
Also see: Tab Triggers