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="bg-indigo-900 px-4 py-4">
<div
class="md:max-w-6xl md:mx-auto md:flex md:items-center md:justify-between"
x-data="{ open: false }"
x-cloak
>
<div class="flex justify-between items-center">
<a href="#" class="inline-block py-2 text-white text-xl font-bold"
>Demopay</a
>
<div
class="inline-block cursor-pointer md:hidden"
x-on:click="open = true"
>
<div class="bg-gray-400 w-8 mb-2" style="height: 2px;"></div>
<div class="bg-gray-400 w-8 mb-2" style="height: 2px;"></div>
<div class="bg-gray-400 w-8" style="height: 2px;"></div>
</div>
</div>
<div x-show="open" x-on:click.away="open = false">
<a href="#" class="block py-2 text-gray-100">How it Works</a>
<a href="#" class="block py-2 text-indigo-300 hover:text-gray-100"
>Services</a
>
<a href="#" class="block py-2 text-indigo-300 hover:text-gray-100"
>Blog</a
>
<div class="flex items-center justify-between pt-4">
<a
href="#"
class="w-1/2 inline-block py-2 px-4 text-gray-600 hover:text-indigo-600 bg-gray-100 hover:bg-gray-200 rounded-lg text-center mr-2 font-bold"
>Login</a
>
<a
href="#"
class="w-1/2 inline-block py-2 px-4 text-white bg-red-500 hover:bg-red-600 rounded-lg text-center font-bold"
>Sign Up</a
>
</div>
</div>
<div>
<div class="hidden md:block">
<a
href="#"
class="inline-block py-1 md:py-4 text-gray-100 mr-6 font-bold"
>How it Works</a
>
<a
href="#"
class="inline-block py-1 md:py-4 text-gray-500 hover:text-gray-100 mr-6"
>Services</a
>
<a
href="#"
class="inline-block py-1 md:py-4 text-gray-500 hover:text-gray-100"
>Blog</a
>
</div>
</div>
<div class="hidden md:block">
<a
href="#"
class="inline-block py-1 md:py-4 text-gray-500 hover:text-gray-100 mr-6"
>Login</a
>
<a
href="#"
class="inline-block py-2 px-4 text-gray-700 bg-white hover:bg-gray-100 rounded-lg"
>Sign Up</a
>
</div>
</div>
</div>
<div class="bg-indigo-900 md:overflow-hidden">
<div class="px-4 py-20 md:py-4">
<div class="md:max-w-6xl md:mx-auto">
<div class="md:flex md:flex-wrap">
<div class="md:w-1/2 text-center md:text-left md:pt-16">
<h1
class="font-bold text-white text-2xl md:text-5xl leading-tight mb-4"
>
Simple payment platform for any service
</h1>
<p class="text-indigo-200 md:text-xl md:pr-48">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Id
vitae corrupti asperiores veritatis dolorum, commodi aperiam
enim.
</p>
<a
href="#"
class="mt-6 mb-12 md:mb-0 md:mt-10 inline-block py-3 px-8 text-white bg-red-500 hover:bg-red-600 rounded-lg shadow"
>Get Started</a
>
</div>
<div class="md:w-1/2 relative">
<div class="hidden md:block">
<div
class="-ml-24 -mb-40 absolute left-0 bottom-0 w-40 bg-white rounded-lg shadow-lg px-6 py-8"
style="transform: rotate(-8deg);"
>
<div
class="bg-indigo-800 mx-auto rounded-lg px-2 pb-2 relative mb-8"
>
<div class="mb-1">
<span
class="w-1 h-1 bg-indigo-100 rounded-full inline-block"
style="margin-right: 1px;"
></span
><span
class="w-1 h-1 bg-indigo-100 rounded-full inline-block"
style="margin-right: 1px;"
></span
><span
class="w-1 h-1 bg-indigo-100 rounded-full inline-block"
></span>
</div>
<div class="h-1 w-12 bg-indigo-100 rounded mb-1"></div>
<div class="h-1 w-10 bg-indigo-100 rounded mb-2"></div>
<div class="flex">
<div class="w-6 h-3 rounded bg-indigo-100 mr-1"></div>
<div class="w-6 h-3 rounded bg-indigo-100"></div>
</div>
<div
class="-mr-2 -mb-4 absolute bottom-0 right-0 h-16 w-10 rounded-lg bg-green-700 border-2 border-white"
></div>
<div
class="w-2 h-2 rounded-full bg-green-800 mx-auto absolute bottom-0 right-0 mr-2 -mb-2 z-10 border-2 border-white"
></div>
</div>
<div class="text-gray-800 text-center">
Online <br />Services
</div>
</div>
<div
class="ml-24 mb-16 absolute left-0 bottom-0 w-40 bg-white rounded-lg shadow-lg px-6 py-8"
style="transform: rotate(-8deg); z-index: 2;"
>
<div
class="bg-indigo-800 mx-auto rounded-lg relative mb-8 py-2 w-20 border-2 border-white"
>
<div
class="h-8 bg-green-700 w-8 rounded absolute left-0 top-0 -mt-3 ml-4"
style="transform: rotate(-45deg); z-index: -1;"
></div>
<div
class="h-8 bg-green-800 w-8 rounded absolute left-0 top-0 -mt-3 ml-8"
style="transform: rotate(-12deg); z-index: -2;"
></div>
<div
class="flex items-center justify-center h-6 bg-indigo-800 w-6 rounded-l-lg ml-auto border-4 border-white -mr-1"
>
<div
class="h-2 w-2 rounded-full bg-indigo-800 border-2 border-white"
></div>
</div>
<div
class="w-8 h-8 bg-green-700 border-4 border-white rounded-full -ml-3 -mb-5"
></div>
</div>
<div class="text-gray-800 text-center">
Banking Services
</div>
</div>
<div
class="ml-32 absolute left-0 bottom-0 w-48 bg-white rounded-lg shadow-lg px-10 py-8"
style="transform: rotate(-8deg); z-index: 2; margin-bottom: -220px;"
>
<div
class="bg-indigo-800 mx-auto rounded-lg pt-4 mb-16 relative"
>
<div class="h-4 bg-white"></div>
<div class="text-right my-2 pb-1">
<div
class="inline-flex w-3 h-3 rounded-full bg-white -mr-2"
></div>
<div
class="inline-flex w-3 h-3 rounded-full bg-indigo-800 border-2 border-white mr-2"
></div>
</div>
<div
class="-ml-4 -mb-6 absolute left-0 bottom-0 w-16 bg-green-700 mx-auto rounded-lg pb-2 pt-3"
>
<div class="h-2 bg-white mb-2"></div>
<div class="h-2 bg-white w-6 ml-auto rounded mr-2"></div>
</div>
</div>
<div class="text-gray-800 text-center">
Payment for <br />Internet
</div>
</div>
<div
class="mt-10 w-full absolute right-0 top-0 flex rounded-lg bg-white overflow-hidden shadow-lg"
style="transform: rotate(-8deg); margin-right: -250px; z-index: 1;"
>
<div class="w-32 bg-gray-200" style="height: 560px;"></div>
<div class="flex-1 p-6">
<h2 class="text-lg text-gray-700 font-bold mb-3">
Popular Payments
</h2>
<div class="flex mb-5">
<div class="w-16 rounded-full bg-gray-100 py-2 px-4 mr-2">
<div class="p-1 rounded-full bg-gray-300"></div>
</div>
<div class="w-16 rounded-full bg-gray-100 py-2 px-4 mr-2">
<div class="p-1 rounded-full bg-gray-300"></div>
</div>
<div class="w-16 rounded-full bg-gray-100 py-2 px-4 mr-2">
<div class="p-1 rounded-full bg-gray-300"></div>
</div>
<div class="w-16 rounded-full bg-gray-100 py-2 px-4">
<div class="p-1 rounded-full bg-gray-300"></div>
</div>
</div>
<div class="flex flex-wrap -mx-4 mb-5">
<div class="w-1/3 px-4">
<div class="h-40 rounded-lg bg-white shadow-lg p-6">
<div
class="w-16 h-16 rounded-full bg-gray-200 mb-6"
></div>
<div
class="h-2 w-16 bg-gray-200 mb-2 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-200 rounded-full"></div>
</div>
</div>
<div class="w-1/3 px-4">
<div class="h-40 rounded-lg bg-white shadow-lg p-6">
<div
class="w-16 h-16 rounded-full bg-gray-200 mb-6"
></div>
<div
class="h-2 w-16 bg-gray-200 mb-2 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-200 rounded-full"></div>
</div>
</div>
<div class="w-1/3 px-4">
<div class="h-40 rounded-lg bg-white shadow-lg p-6">
<div
class="w-16 h-16 rounded-full bg-gray-200 mb-6"
></div>
<div
class="h-2 w-16 bg-gray-200 mb-2 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-200 rounded-full"></div>
</div>
</div>
</div>
<h2 class="text-lg text-gray-700 font-bold mb-3">
Popular Payments
</h2>
<div
class="w-full flex flex-wrap justify-between items-center border-b-2 border-gray-100 py-3"
>
<div class="w-1/3">
<div class="flex">
<div class="h-8 w-8 rounded bg-gray-200 mr-4"></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div
class="h-2 w-10 bg-gray-100 rounded-full"
></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-green-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-green-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-10 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
<div
class="flex flex-wrap justify-between items-center border-b-2 border-gray-100 py-3"
>
<div class="w-1/3">
<div class="flex">
<div class="h-8 w-8 rounded bg-gray-200 mr-4"></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div
class="h-2 w-10 bg-gray-100 rounded-full"
></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-orange-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-orange-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-16 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
<div
class="flex flex-wrap justify-between items-center border-b-2 border-gray-100 py-3"
>
<div class="w-1/3">
<div class="flex">
<div class="h-8 w-8 rounded bg-gray-200 mr-4"></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div
class="h-2 w-10 bg-gray-100 rounded-full"
></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-blue-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-blue-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-8 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
</div>
</div>
<div
class="w-full absolute left-0 bottom-0 ml-1"
style="transform: rotate(-8deg); z-index: 1; margin-bottom: -360px;"
>
<div class="grid--gray h-48 w-48"></div>
</div>
</div>
<div
class="md:hidden w-full absolute right-0 top-0 flex rounded-lg bg-white overflow-hidden shadow"
>
<div
class="h-4 bg-gray-200 absolute top-0 left-0 right-0 rounded-t-lg flex items-center"
>
<span
class="h-2 w-2 rounded-full bg-red-500 inline-block mr-1 ml-2"
></span>
<span
class="h-2 w-2 rounded-full bg-orange-400 inline-block mr-1"
></span>
<span
class="h-2 w-2 rounded-full bg-green-500 inline-block mr-1"
></span>
</div>
<div class="w-32 bg-gray-100 px-2 py-8" style="height: 340px;">
<div class="h-2 w-16 bg-gray-300 rounded-full mb-4"></div>
<div class="flex items-center mb-4">
<div
class="h-5 w-5 rounded-full bg-gray-300 mr-3 flex-shrink-0"
></div>
<div>
<div class="h-2 w-10 bg-gray-300 rounded-full"></div>
</div>
</div>
<div class="h-2 w-16 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-10 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-20 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-6 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-16 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-10 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-20 bg-gray-200 rounded-full mb-2"></div>
<div class="h-2 w-6 bg-gray-200 rounded-full mb-2"></div>
</div>
<div class="flex-1 px-4 py-8">
<h2 class="text-xs text-gray-700 font-bold mb-1">
Popular Payments
</h2>
<div class="flex mb-5">
<div class="p-2 w-12 rounded-full bg-gray-100 mr-2"></div>
<div class="p-2 w-12 rounded-full bg-gray-100 mr-2"></div>
<div class="p-2 w-12 rounded-full bg-gray-100 mr-2"></div>
<div class="p-2 w-12 rounded-full bg-gray-100 mr-2"></div>
</div>
<div class="flex flex-wrap -mx-2 mb-5">
<div class="w-1/3 px-2">
<div class="p-3 rounded-lg bg-white shadow">
<div
class="w-6 h-6 rounded-full bg-gray-200 mb-2"
></div>
<div
class="h-2 w-10 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-6 bg-gray-200 rounded-full"></div>
</div>
</div>
<div class="w-1/3 px-2">
<div class="p-3 rounded-lg bg-white shadow">
<div
class="w-6 h-6 rounded-full bg-gray-200 mb-2"
></div>
<div
class="h-2 w-10 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-6 bg-gray-200 rounded-full"></div>
</div>
</div>
<div class="w-1/3 px-2">
<div class="p-3 rounded-lg bg-white shadow">
<div
class="w-6 h-6 rounded-full bg-gray-200 mb-2"
></div>
<div
class="h-2 w-10 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-6 bg-gray-200 rounded-full"></div>
</div>
</div>
</div>
<h2 class="text-xs text-gray-700 font-bold mb-1">
Popular Payments
</h2>
<div
class="w-full flex flex-wrap justify-between items-center border-b-2 border-gray-100 py-3"
>
<div class="w-1/3">
<div class="flex">
<div
class="h-5 w-5 rounded-full bg-gray-200 mr-3 flex-shrink-0"
></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-100 rounded-full"></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-green-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-green-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-10 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
<div class="flex flex-wrap justify-between items-center py-3">
<div class="w-1/3">
<div class="flex">
<div
class="h-5 w-5 rounded-full bg-gray-200 mr-3 flex-shrink-0"
></div>
<div>
<div
class="h-2 w-16 bg-gray-200 mb-1 rounded-full"
></div>
<div class="h-2 w-10 bg-gray-100 rounded-full"></div>
</div>
</div>
</div>
<div class="w-1/3">
<div
class="w-16 rounded-full bg-orange-100 py-2 px-4 mx-auto"
>
<div class="p-1 rounded-full bg-orange-200"></div>
</div>
</div>
<div class="w-1/3">
<div
class="h-2 w-16 bg-gray-100 rounded-full mx-auto"
></div>
</div>
</div>
</div>
</div>
<div
class="mr-3 md:hidden absolute right-0 bottom-0 w-40 bg-white rounded-lg shadow-lg px-10 py-6"
style="z-index: 2; margin-bottom: -380px;"
>
<div
class="bg-indigo-800 mx-auto rounded-lg w-20 pt-3 mb-12 relative"
>
<div class="h-3 bg-white"></div>
<div class="text-right my-2">
<div
class="inline-flex w-3 h-3 rounded-full bg-white -mr-2"
></div>
<div
class="inline-flex w-3 h-3 rounded-full bg-indigo-800 border-2 border-white mr-2"
></div>
</div>
<div
class="-ml-4 -mb-6 absolute left-0 bottom-0 w-16 bg-green-700 mx-auto rounded-lg pb-2 pt-3"
>
<div class="h-2 bg-white mb-2"></div>
<div class="h-2 bg-white w-6 ml-auto rounded mr-2"></div>
</div>
</div>
<div class="text-gray-800 text-center text-sm">
Payment for <br />Internet
</div>
</div>
</div>
</div>
</div>
</div>
<svg
class="fill-current text-white hidden md:block"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1440 320"
>
<path fill-opacity="1" d="M0,224L1440,32L1440,320L0,320Z"></path>
</svg>
</div>
<p class="text-center p-4 text-gray-600 pt-10">
Created by
<a
class="border-b text-blue-500"
href="https://twitter.com/mithicher"
target="_blank"
>@mithicher</a
>. Inspired by dribble shot
<a
href="https://dribbble.com/shots/8807920-Quickpay-Hero-section/attachments/1015863"
target="_blank"
class="border-b text-blue-500"
>https://dribbble.com/vadimdrut</a
>
</p>
* {
-webkit-tab-highlight-color: transparent;
font-family: "Nunito Sans", sans-serif;
}
[x-cloak] {
display: none;
}
.grid--gray {
background-image: radial-gradient(#ddd 3px, transparent 3px);
background-size: 24px 24px;
}
Also see: Tab Triggers