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="flex h-screen">
<aside class="flex flex-col items-center justify-center h-full p-4 bg-indigo-800 ">
<div>
<nav>
<ul class="flex flex-col space-y-6">
<li>
<a href="">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white/70" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
</svg>
</a>
</l>
<li>
<a href="">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white/70" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
</a>
</li>
<li>
<a href="">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white/70" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" />
</svg>
</a>
</li>
<li>
<a href="">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white/70" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z" />
</svg>
</a>
</li>
<li>
<a href="">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white/70" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" />
</svg>
</a>
</li>
</ul>
</nav>
</div>
</aside>
<div class="flex-1 h-screen overflow-auto">
<header class="w-full flex justify-between items-center p-4">
<div class="relative">
<span class="absolute inset-y-0 left-0 flex items-center pl-2">
<button type="submit" class="p-1 focus:outline-none focus:shadow-outline">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" class="w-5 h-5 text-gray-600">
<path d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
</button>
</span>
<input class="py-2 pl-10 rounded-lg bg-gray-100" type="text" placeholder="Search here">
</div>
<div class="flex space-x-2">
<button class="rounded-full bg-gray-100 p-1">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</button>
<button class="rounded-full bg-gray-100 p-1">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" />
</svg>
</button>
</div>
</header>
<main class="flex flex-col px-6 space-y-4">
<div class="flex flex-col w-full bg-gradient-to-r from-indigo-700 to-indigo-900 p-8 rounded">
<h2 class="text-gray-100 font-bold text-2xl">Champions League</h2>
<p class="text-gray-200 text-sm">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quisquam numquam similique fugiat quia mollitia maxime </p>
</div>
<div class="flex gap-3 w-full p-1">
<div class="flex flex-col p-4 shadow-lg space-y-4 w-1/3">
<div class="flex justify-between items-center">
<h2 class="text-xs font-semibold">UFC Quarter Final</h2>
<span class="bg-red-500 text-white rounded-lg text-xs px-2 ml-2">
Live
</span>
</div>
<div class="flex justify-between items-center">
<div>
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
</div>
<div><span class="text-red-400 text-xs">
3:18
</span></div>
<div>
<img class="w-8" src="https://upload.wikimedia.org/wikipedia/tr/9/98/Real_Madrid.png" alt="">
</div>
</div>
</div>
<div class="flex flex-col p-4 shadow-lg space-y-4 w-1/3">
<div class="flex justify-between items-center">
<h2 class="text-xs font-semibold">UFC Quarter Final</h2>
<span class="bg-red-500 text-white rounded-lg text-xs px-2 ml-2">
Live
</span>
</div>
<div class="flex justify-between items-center">
<div>
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
</div>
<div><span class="text-red-400 text-xs">
3:18
</span></div>
<div>
<img class="w-8" src="https://upload.wikimedia.org/wikipedia/tr/9/98/Real_Madrid.png" alt="">
</div>
</div>
</div>
<div class="flex flex-col p-4 shadow-lg space-y-4 w-1/3">
<div class="flex justify-between items-center">
<h2 class="text-xs font-semibold">UFC Quarter Final</h2>
<span class="bg-red-500 text-white rounded-lg text-xs px-2 ml-2">
Live
</span>
</div>
<div class="flex justify-between items-center">
<div>
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
</div>
<div><span class="text-red-400 text-xs">
3:18
</span></div>
<div>
<img class="w-8" src="https://upload.wikimedia.org/wikipedia/tr/9/98/Real_Madrid.png" alt="">
</div>
</div>
</div>
<div class="flex flex-col p-4 shadow-lg space-y-4 w-1/3">
<div class="flex justify-between items-center space-x-3">
<h2 class="text-xs font-semibold">UFC Quarter Final</h2>
<span class="bg-red-500 text-white rounded-lg text-xs px-2 ml-2">
Live
</span>
</div>
<div class="flex justify-between items-center">
<div>
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
</div>
<div><span class="text-red-400 text-xs">
3:18
</span></div>
<div>
<img class="w-8" src="https://upload.wikimedia.org/wikipedia/tr/9/98/Real_Madrid.png" alt="">
</div>
</div>
</div>
</div>
<section class="flex justify-between gap-3 flex-grow h-1/4">
<div class="flex flex-col bg-gray-100 p-4 w-1/3">
<div class="flex justify-between items-center mb-6">
<h2 class="font-bold">Top Scorer</h2>
<span class="text-xs">view all</span>
</div>
<div class="flex flex-col space-y-3">
<div class="flex justify-between items-center p-2 shadow bg-white rounded-xl">
<div class="flex justify-between space-x-2">
<div>
<img class="rounded-full w-12" src="https://randomuser.me/api/portraits/med/men/75.jpg" alt="">
</div>
<div class="flex flex-col">
<h4 class="text-gray-700">
Erling Hazard
</h4>
<p class="text-xs text-gray-500">
PSG
</p>
</div>
</div>
<span class="rounded-full bg-gray-100 p-1 text-sm">
12
</span>
</div>
<div class="flex justify-between items-center p-2 shadow bg-white rounded-xl">
<div class="flex justify-between space-x-2">
<div>
<img class="rounded-full w-12" src="https://randomuser.me/api/portraits/med/men/75.jpg" alt="">
</div>
<div class="flex flex-col">
<h4 class="text-gray-700">
Erling Hazard
</h4>
<p class="text-xs text-gray-500">
PSG
</p>
</div>
</div>
<span class="rounded-full bg-gray-100 p-1 text-sm">
12
</span>
</div>
<div class="flex justify-between items-center p-2 shadow bg-white rounded-xl">
<div class="flex justify-between space-x-2">
<div>
<img class="rounded-full w-12" src="https://randomuser.me/api/portraits/med/men/75.jpg" alt="">
</div>
<div class="flex flex-col">
<h4 class="text-gray-700">
Erling Hazard
</h4>
<p class="text-xs text-gray-500">
PSG
</p>
</div>
</div>
<span class="rounded-full bg-gray-100 p-1 text-sm">
12
</span>
</div>
</div>
</div>
<div class="flex flex-col bg-gray-100 p-4 w-1/3">
<div class="flex justify-between items-center mb-6">
<h2 class="font-bold">Result</h2>
<span class="text-xs">view all</span>
</div>
<div class="flex flex-col space-y-4">
<div class="flex flex-col text-white">
<div class="flex justify-between gap-2 items-center text-xs bg-gray-800 p-3 rounded-xl">
<div class="flex items-center gap-3">
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
<h4>Porto</h4>
</div>
<div class="flex bg-blue-700 p-1 rounded">
<span>1</span>
<span> - </span>
<span>3</span>
</div>
<div class="flex items-center gap-3">
<h4>Chelsea</h4>
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
</div>
</div>
</div>
<div class="flex flex-col text-white">
<div class="flex justify-between gap-2 items-center text-xs bg-gray-800 p-3 rounded-xl">
<div class="flex items-center gap-3">
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
<h4>Porto</h4>
</div>
<div class="flex bg-blue-700 p-1 rounded">
<span>1</span>
<span> - </span>
<span>3</span>
</div>
<div class="flex items-center gap-3">
<h4>Chelsea</h4>
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
</div>
</div>
</div>
<div class="flex flex-col text-white">
<div class="flex justify-between gap-2 items-center text-xs bg-gray-800 p-3 rounded-xl">
<div class="flex items-center gap-3">
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
<h4>Porto</h4>
</div>
<div class="flex bg-blue-700 p-1 rounded">
<span>1</span>
<span> - </span>
<span>3</span>
</div>
<div class="flex items-center gap-3">
<h4>Chelsea</h4>
<img class="w-8" src="https://cdn.freebiesupply.com/logos/large/2x/fc-barcelona-logo-png-transparent.png" alt="">
</div>
</div>
</div>
</div>
</div>
<div class="flex flex-col bg-gray-100 p-4 w-1/3">
<div class="flex justify-between items-center mb-6">
<h2 class="font-bold">Result</h2>
<span class="text-xs">view all</span>
</div>
<div class="flex flex-col justify-between space-y-4 ">
<div class="flex flex-col text-white overflow-auto flex-grow space-y-3">
<div class="flex justify-between gap-2 items-center text-xs bg-indigo-800 p-3 rounded-xl">
<div>
<h2 class="font-semibold text-lg">News</h2>
<p class="text-xs">Lorem ipsum dolor sit amet consectetur adipisicing elit. Amet dignissimos officiis voluptatum suscipit, temporibus recusandae esse.</p>
</div>
</div>
<div class="flex justify-between gap-2 items-center text-xs bg-indigo-800 p-3 rounded-xl">
<div>
<h2 class="font-semibold text-lg">News</h2>
<p class="text-xs">Lorem ipsum dolor sit amet consectetur adipisicing elit. Amet dignissimos officiis voluptatum suscipit, temporibus recusandae esse.</p>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
</div>
</div>
Also see: Tab Triggers