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.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.5/sweetalert2.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.5/sweetalert2.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/core.js"></script>
<a href="#last">Hello</a>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus assumenda a unde voluptas sint eaque ab libero veritatis officia alias repellendus quae quos incidunt eveniet, maxime fugit magnam ut hic.</p>
<p>Omnis voluptatem tempore eaque in error temporibus veniam similique praesentium doloribus quod totam unde ullam, nihil veritatis facere. Aperiam placeat sequi hic autem fugit soluta sunt ullam est, voluptas tempore.</p>
<p>Ipsum dolorum autem labore, nesciunt eius ullam earum ipsa incidunt, distinctio sunt ea reiciendis optio tempore magni illum sit non repudiandae quaerat ex aspernatur perferendis nisi corporis eos. Atque, voluptatibus!</p>
<p>Libero quis laboriosam excepturi a aliquid. Esse necessitatibus tempore cumque dolores nostrum natus, nam, quisquam, fugit neque quaerat ipsum voluptate incidunt, doloremque assumenda voluptatum. Deleniti ipsam veritatis harum repellat temporibus.</p>
<p>Et quod dolores esse laboriosam asperiores quidem, nesciunt error iure fuga! Praesentium necessitatibus ea, nobis nesciunt quasi aspernatur, iste facere iusto ut! Voluptates voluptate numquam, porro provident cupiditate est aliquam.</p>
<p>Dolore molestias magni iusto aspernatur ut molestiae veniam aut facere unde, atque blanditiis ex, ea iste aperiam aliquam libero veritatis consequatur nihil, cupiditate minus. Reiciendis sit sed cum quidem repellendus!</p>
<p>Ad praesentium architecto, itaque repellendus fugit recusandae tempora ex hic? Libero, nulla cum nisi minus. Vitae, nobis! Nobis ex vel nostrum minus, iste saepe facere ipsum rerum, doloremque libero aut!</p>
<p>Repellat voluptas neque minus at accusantium odit corporis, quod obcaecati numquam minima, rem deserunt culpa, ullam voluptatibus laudantium debitis tempora, adipisci quidem ipsum nobis qui voluptates totam maiores? Culpa, doloribus!</p>
<p>Perferendis sit delectus rerum architecto vel ab id enim suscipit dolorem quas, doloremque est dolores earum quam vitae placeat alias atque labore magni ipsum corporis quo amet ea. Molestiae, nesciunt.</p>
<p>Dolor asperiores corporis doloremque, voluptatibus repellendus cum velit nostrum temporibus enim, ipsum alias eos provident aliquid magnam incidunt quidem placeat consectetur architecto esse officiis illo! Ipsum nulla amet asperiores consequuntur.</p>
<p>Assumenda impedit temporibus aliquid doloribus repudiandae. Et, ut nisi? Voluptates quo beatae sint, harum enim officiis optio tenetur perspiciatis, dolorum officia aspernatur culpa minus deserunt rerum, veritatis eveniet, facere magni.</p>
<p>Sit in, quis consequuntur accusamus quae doloribus, ducimus adipisci enim, placeat explicabo ullam magni dignissimos, rem harum id ex officiis veritatis suscipit blanditiis. Praesentium totam fugiat magni illo temporibus doloremque.</p>
<p>Molestiae repellendus iure a maxime, incidunt beatae delectus cum explicabo aliquid, doloremque dolorem voluptas recusandae! Maxime, minus? Quisquam pariatur, doloribus reiciendis tempora voluptas saepe, eum voluptatem sequi, perferendis corporis omnis.</p>
<p>Aut fuga, optio vel maiores numquam accusantium itaque id explicabo ipsa, hic. Eius ipsam velit atque culpa est at recusandae, minus iste beatae. Ab maiores est facere adipisci a dicta.</p>
<p id="last">Mollitia magnam reprehenderit maiores velit. Explicabo sint laborum laudantium, dolore commodi provident, libero atque ullam quos autem illum aspernatur architecto cum doloremque qui facilis voluptatibus soluta possimus saepe. Beatae, tempore?</p>
$(function () {
$("a").click(function () {
swal({
title: 'If you know the hire code, please enter.',
input: 'text',
type: 'question',
showCancelButton: true,
confirmButtonText: 'Hire Me',
cancelButtonText: 'Contact',
inputValidator: function (value) {
return new Promise(function (resolve, reject) {
if (value) {
resolve()
} else {
reject('You need to write something!')
}
})
}
});
});
});
Also see: Tab Triggers