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="container">
<p>Velit esse autem sed dolores facere aperiam ab provident eveniet quia ratione et voluptatem quia ipsum. Et ipsam tempore cum iusto perferendis et temporibus sint nostrum molestiae quia quisquam laborum. Nisi a qui voluptatem. Est explicabo non non dolor debitis sed quaerat repudiandae. Magni voluptas autem et minus pariatur velit eveniet suscipit molestias laboriosam qui voluptatem. Quisquam officia minus voluptas dolor tempore et quod qui qui ut. Dicta est eveniet porro fuga recusandae doloribus minus excepturi temporibus nostrum corrupti. Rerum vitae veritatis perferendis velit quisquam nesciunt unde id consectetur laborum nihil assumenda dolor ut ex. Ut dolorem eos dolor et beatae. Velit et provident sint nulla quia libero voluptatem cumque tempora animi. Aut laboriosam harum aut nihil rerum ut dignissimos cupiditate nesciunt est reiciendis beatae. Perspiciatis aliquam nihil eos deserunt eum et laborum molestias nihil quis.
Sint et porro quia est et molestiae nesciunt voluptatibus error occaecati ut. Voluptas ut aut architecto. Sunt sit iusto accusamus enim quia ut. Fugit voluptas quia qui sit quaerat atque voluptatem autem dolor distinctio itaque nemo repellendus. Aut mollitia veniam ut. Aut qui sed architecto doloribus similique. Odit aut expedita et quibusdam est sint omnis itaque provident dolores ea et quod. Ut illum cum quia illum sed vel vel necessitatibus minima ut eos omnis debitis eveniet.
Praesentium corporis a corrupti ut voluptatem eos ea et amet quasi voluptatem. Omnis laboriosam facilis libero qui est tempore dolorum. Facilis reiciendis doloremque ullam quo eius nihil quidem. Sequi necessitatibus qui nihil est deleniti natus.
Quae tenetur ut dicta porro quo facilis perspiciatis quis. Excepturi consequatur qui ut quo ut numquam tempore deleniti animi. Neque consequatur occaecati facilis voluptas. Ut aut quia est quo aut omnis est quaerat error debitis rerum. Saepe minus voluptate enim qui quam illo commodi error aut autem et. Placeat autem quis dolorum. Qui perferendis at ut id facilis hic corrupti dolorem fuga porro facilis laboriosam eum minus voluptas. Delectus occaecati provident accusantium molestias at veritatis perspiciatis optio sint dolor omnis culpa non qui vero.
Quia mollitia incidunt id. Labore doloremque est esse quia quis laborum molestiae harum laborum enim. Exercitationem eum at aspernatur dolorum architecto consequatur sed odit voluptas voluptatem ducimus voluptatem odio soluta inventore. Tempora quia laboriosam nemo.
Nostrum accusamus in sed harum eius. Ducimus architecto quam est vel commodi reprehenderit. Nulla perferendis veniam quisquam. Iure ratione similique voluptatem voluptatum ullam dolorum dolores alias quos et dolores tempore dolor. Beatae tempora ut debitis vitae sint.
Ad ratione accusamus nemo porro facilis dolores nam quo excepturi culpa enim tempora. Neque consectetur nulla incidunt maxime fugiat eligendi ut impedit id quod facilis est et itaque. Doloremque impedit consequuntur accusantium itaque nulla soluta nihil labore qui corporis in nemo aut nihil. Ea numquam aliquid aspernatur quod dolore non. Enim officiis et consectetur non laboriosam consequatur earum eos itaque repellendus odit quia provident expedita. Modi nihil dolor rem officiis ducimus quia debitis.
Ullam incidunt fuga delectus tenetur quaerat officiis. Voluptas possimus quae velit natus rerum dolor itaque. Placeat mollitia molestiae in harum sed ipsam doloribus ut saepe consequuntur facere sed. Qui voluptate non sequi quod expedita veniam earum odit quos.
Iusto modi ut veniam ducimus hic vel laudantium nulla laboriosam. Consequatur fugit velit quasi voluptatem odio expedita recusandae tenetur laboriosam totam vel nam. Iste incidunt qui voluptas voluptas temporibus sunt voluptatem minima et saepe tenetur recusandae ut sit suscipit. Occaecati aperiam praesentium placeat consequatur voluptatem dolores id beatae ut aut recusandae repellat reiciendis voluptatem. Dolor dolor ut iusto reprehenderit voluptatibus quia aut ullam a impedit. Enim sapiente optio culpa a minus aut nobis id repudiandae eos. Itaque omnis cum rerum amet ipsum et eos et provident totam quod enim nobis. Mollitia ut sequi fugit sit in qui quia quo omnis facilis quae doloremque mollitia. Enim quis quam vitae sit quia voluptatibus.
Non ullam cupiditate doloribus velit qui tempora sed dolorem praesentium voluptas. Sed cumque laudantium placeat eligendi qui voluptatem placeat debitis velit consequatur ut nihil aut sint. Officia animi dolorem nemo placeat dolor quae voluptatum nihil sed iusto est. Praesentium sed possimus inventore a magni est ipsum nihil. Omnis dolor sequi nemo. Ex molestiae ab omnis cupiditate iure molestiae quas qui consequuntur qui cum molestias voluptatum.
Et rerum ducimus rerum vero et reiciendis ipsum mollitia dolores omnis repudiandae unde.
Sit dolor quia quis ea voluptate eligendi maxime illum sint neque cumque velit amet illo.
Ea quia quis corrupti qui nostrum molestias ex.
Excepturi perferendis autem earum at autem sapiente incidunt quis ullam repellat ab dolorem qui cupiditate.
Aliquam aut eveniet est corporis sit sed consequuntur nemo fugiat hic atque nihil a.
Nulla voluptatem ipsum modi quaerat velit voluptatem ullam animi maiores voluptate expedita placeat quo.
Est quo rerum rerum tenetur itaque dolores voluptatem tenetur vitae quis soluta sit ut eum.
</p>
<div class="progressive-blur-container">
<div class="blur-filter"></div>
<div class="blur-filter"></div>
<div class="blur-filter"></div>
<div class="blur-filter"></div>
<div class="blur-filter"></div>
<div class="blur-filter"></div>
<div class="blur-filter"></div>
<div class="gradient"></div>
</div>
</div>
.container {
position: relative;
width: 500px;
}
.progressive-blur-container {
position: absolute;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 50%;
pointer-event: none;
}
.progressive-blur-container > .blur-filter {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.progressive-blur-container > .blur-filter:nth-child(1) {
backdrop-filter: blur(1px);
mask: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 40%);
}
.progressive-blur-container > .blur-filter:nth-child(2) {
backdrop-filter: blur(2px);
mask: linear-gradient(rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 50%);
}
.progressive-blur-container > .blur-filter:nth-child(3) {
backdrop-filter: blur(4px);
mask: linear-gradient(rgba(0, 0, 0, 0) 15%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 60%);
}
.progressive-blur-container > .blur-filter:nth-child(4) {
backdrop-filter: blur(8px);
mask: linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 70%);
}
.progressive-blur-container > .blur-filter:nth-child(5) {
backdrop-filter: blur(16px);
mask: linear-gradient(rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0) 90%);
}
.progressive-blur-container > .blur-filter:nth-child(6) {
backdrop-filter: blur(32px);
mask: linear-gradient(rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 1) 80%);
}
.progressive-blur-container > .blur-filter:nth-child(7) {
z-index: 10;
background-filter: blur(64px);
mask: linear-gradient(rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 1) 100%)
}
.progressive-blur-container > .gradient {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(transparent, #ffffff);
}
p {
height: 300px;
overflow: scroll;
}
Also see: Tab Triggers