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="bg-gray-200 relative min-h-screen antialiased border-t-8 border-black">
<div class="max-w-sm mx-auto px-6">
<div class="relative flex flex-wrap">
<div class="w-full relative">
<div class="mt-6">
<div class="text-center font-semibold text-black">
Lorem ipsum dolor
</div>
<div class="text-center font-base text-black">
Sed ut perspiciatis unde?
</div>
<form class="mt-8" x-data="{password: '',password_confirm: ''}">
<div class="mx-auto max-w-lg ">
<div class="py-1">
<span class="px-1 text-sm text-gray-600">Username</span>
<input placeholder="" type="text"
class="text-md block px-3 py-2 rounded-lg w-full
bg-white border-2 border-gray-300 placeholder-gray-600 shadow-md focus:placeholder-gray-500 focus:bg-white focus:border-gray-600 focus:outline-none">
</div>
<div class="py-1">
<span class="px-1 text-sm text-gray-600">Email</span>
<input placeholder="" type="email"
class="text-md block px-3 py-2 rounded-lg w-full
bg-white border-2 border-gray-300 placeholder-gray-600 shadow-md focus:placeholder-gray-500 focus:bg-white focus:border-gray-600 focus:outline-none">
</div>
<div class="py-1">
<span class="px-1 text-sm text-gray-600">Password</span>
<input placeholder="" type="password" x-model="password"
class="text-md block px-3 py-2 rounded-lg w-full
bg-white border-2 border-gray-300 placeholder-gray-600 shadow-md focus:placeholder-gray-500 focus:bg-white focus:border-gray-600 focus:outline-none">
</div>
<div class="py-1">
<span class="px-1 text-sm text-gray-600">Password Confirm</span>
<input placeholder="" type="password" x-model="password_confirm"
class="text-md block px-3 py-2 rounded-lg w-full
bg-white border-2 border-gray-300 placeholder-gray-600 shadow-md focus:placeholder-gray-500 focus:bg-white focus:border-gray-600 focus:outline-none">
</div>
<div class="flex justify-start mt-3 ml-4 p-1">
<ul>
<li class="flex items-center py-1">
<div :class="{'bg-green-200 text-green-700': password == password_confirm && password.length > 0, 'bg-red-200 text-red-700':password != password_confirm || password.length == 0}"
class=" rounded-full p-1 fill-current ">
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path x-show="password == password_confirm && password.length > 0" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M5 13l4 4L19 7"/>
<path x-show="password != password_confirm || password.length == 0" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M6 18L18 6M6 6l12 12"/>
</svg>
</div>
<span :class="{'text-green-700': password == password_confirm && password.length > 0, 'text-red-700':password != password_confirm || password.length == 0}"
class="font-medium text-sm ml-3"
x-text="password == password_confirm && password.length > 0 ? 'Passwords match' : 'Passwords do not match' "></span>
</li>
<li class="flex items-center py-1">
<div :class="{'bg-green-200 text-green-700': password.length > 7, 'bg-red-200 text-red-700':password.length < 7 }"
class=" rounded-full p-1 fill-current ">
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path x-show="password.length > 7" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M5 13l4 4L19 7"/>
<path x-show="password.length < 7" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M6 18L18 6M6 6l12 12"/>
</svg>
</div>
<span :class="{'text-green-700': password.length > 7, 'text-red-700':password.length < 7 }"
class="font-medium text-sm ml-3"
x-text="password.length > 7 ? 'The minimum length is reached' : 'At least 8 characters required' "></span>
</li>
</ul>
</div>
<div class="flex justify-start">
<label class="block text-gray-500 font-bold my-4 flex items-center">
<input class="leading-loose text-pink-600 top-0" type="checkbox"/>
<span class="ml-2 text-sm py-2 text-gray-600 text-left">Accept the
<a href="#"
class="font-semibold text-black border-b-2 border-gray-200 hover:border-gray-500">
Terms and Conditions of the site
</a>and
<a href="#"
class="font-semibold text-black border-b-2 border-gray-200 hover:border-gray-500">
the information data policy.</a>
</span>
</label>
</div>
<button class="mt-3 text-lg font-semibold
bg-gray-800 w-full text-white rounded-lg
px-6 py-3 block shadow-xl hover:text-white hover:bg-black">
Register
</button>
</div>
</form>
<div class="text-sm font-semibold block sm:hidden py-6 flex justify-center">
<a href="#"
class="text-black font-normal border-b-2 border-gray-200 hover:border-teal-500">You're already member?
<span class="text-black font-semibold">
Login
</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
Also see: Tab Triggers