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.
<body class="font-sans font-light h-screen">
<div class="flex items-center justify-between lg:justify-start w-full text-white bg-blue-600">
<div class="flex items-center justify-between lg:w-2/12">
<div class="flex justify-between items-center">
<a href="#" class="block lg:hidden no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--GlobalNavButton"></i>
</a>
<a href="#" class="block lg:hidden no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--Search"></i>
</a>
<a href="#" class="hidden lg:block no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--WaffleOffice365"></i>
</a>
<h1 class="hidden lg:block font-semibold px-2">Outlook</h1>
</div>
</div>
<span class="lg:hidden font-semibold">
Inbox
</span>
<div class="flex lg:hidden items-stretch justify-end">
<a href="#" class="no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--SingleColumnEdit"></i>
</a>
</div>
<div class="hidden lg:flex items-center justify-between w-10/12">
<div class="relative flex flex-grow items-center bg-blue-300 text-blue-700 rounded-sm mr-4">
<span class="absolute left-0 px-3">
<i class="ms-Icon ms-Icon--Search"></i>
</span>
<input type="text" class="hidden lg:block no-appearance bg-blue-300 placeholder-blue-700 py-1 ml-10" placeholder="Search">
</div>
<div class="hidden lg:flex items-stretch justify-end">
<a href="#" class="no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--SkypeLogo"></i>
</a>
<a href="#" class="no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--Diamond"></i>
</a>
<a href="#" class="no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--EventToDoLogo"></i>
</a>
<a href="#" class="no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--Settings"></i>
</a>
<a href="#" class="no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--Help"></i>
</a>
<a href="#" class="no-underline hover:bg-blue-700 p-4">
<i class="ms-Icon ms-Icon--Megaphone"></i>
</a>
<a href="#" class="flex items-center no-underline hover:bg-blue-700 px-3">
<span class="flex items-center justify-center w-32px bg-purple-500 rounded-full">
D8
</span>
</a>
</div>
</div>
</div>
<div class="flex items-center justify-between w-full border-b border-gray-400 p-2">
<div class="hidden lg:flex items-center w-full">
<div class="w-2/12">
<a href="#" class="no-underline hover:bg-gray-100 text-blue-700 p-1 mx-2">
<i class="ms-Icon ms-Icon--GlobalNavButton"></i>
</a>
<a href="#" class="font-semibold bg-blue-600 text-sm text-white rounded-sm p-2 mx-2">
New message
</a>
</div>
<div class="flex flex-nowrap w-10/12 text-sm">
<a href="#" class="inline-flex items-center no-underline hover:bg-gray-100 text-blue-700 p-1 mr-2">
<i class="ms-Icon ms-Icon--Delete mr-1"></i>
Remove
</a>
<a href="#" class="inline-flex items-center no-underline hover:bg-gray-100 text-blue-700 p-1 mx-2">
<i class="ms-Icon ms-Icon--Archive mr-1"></i>
Archive
</a>
<a href="#" class="inline-flex items-center no-underline hover:bg-gray-100 text-blue-700 p-1 mx-2">
<i class="ms-Icon ms-Icon--Blocked mr-1"></i>
Spam
<i class="ms-Icon ms-Icon--ChevronDownMed text-xs ml-2"></i>
</a>
<a href="#" class="inline-flex items-center no-underline hover:bg-gray-100 text-blue-700 p-1 mx-2">
<i class="ms-Icon ms-Icon--Broom mr-1"></i>
Sweep
</a>
<a href="#" class="inline-flex items-center no-underline hover:bg-gray-100 text-blue-700 p-1 mx-2">
<i class="ms-Icon ms-Icon--FabricMovetoFolder mr-1"></i>
Move to
<i class="ms-Icon ms-Icon--ChevronDownMed text-xs ml-2"></i>
</a>
<a href="#" class="inline-flex items-center no-underline hover:bg-gray-100 text-blue-700 p-1 mx-2">
<i class="ms-Icon ms-Icon--Tag mr-1"></i>
Categorise
<i class="ms-Icon ms-Icon--ChevronDownMed text-xs ml-2"></i>
</a>
<a href="#" class="inline-flex items-center no-underline hover:bg-gray-100 text-blue-700 p-1 mx-2">
<i class="ms-Icon ms-Icon--Clock mr-1"></i>
Snooze
<i class="ms-Icon ms-Icon--ChevronDownMed text-xs ml-2"></i>
</a>
<a href="#" class="inline-flex items-center no-underline hover:bg-gray-100 text-blue-700 p-1 mx-2">
<i class="ms-Icon ms-Icon--More"></i>
</a>
</div>
</div>
<div class="flex lg:hidden rounded-full bg-gray-300 text-gray-700 border-2 border-gray-300">
<div class="text-blue-500 rounded-full bg-white py-1 px-2">
Focused
</div>
<span class="py-1 px-2">
Other
</span>
</div>
<a href="#" class="flex lg:hidden items-center text-sm text-gray-700">
<i class="ms-Icon ms-Icon--Filter mr-1"></i>
Filter
</a>
</div>
<div class="relative overflow-y-scroll h-screen">
<div class="absolute lg:flex w-screen">
<div class="block lg:flex lg:w-1/2 hover:bg-gray-200 border-b border-gray-400 py-2 px-4">
<span class="hidden lg:flex flex-shrink-0 items-center justify-center w-32px bg-blue-500 text-white rounded-full">
M
</span>
<div class="lg:ml-3">
<h3 class="text-base truncate">
Microsoft
</h3>
<div class="flex flex-nowrap justify-between items-center">
<h4 class="truncate text-sm pr-2">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Eius sunt adipisci similique dolore obcaecati vitae a debitis dolorum quos quod. Eos neque a nisi porro totam ut voluptatem, praesentium recusandae?
</h4>
<span class="flex-shrink-0 text-xs text-gray-700 text-right">
Sun 29/12
</span>
</div>
<p class="text-sm text-gray-800 truncate">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ipsam odit deserunt sequi voluptatibus animi tempora placeat facilis dolore exercitationem soluta. Officiis exercitationem voluptatem consequatur sed fugit deserunt optio nihil fuga.
</p>
</div>
</div>
<!-- <div class="hidden lg:block lg:w-1/2">
<h1>Test</h1>
</div> -->
</div>
</div>
<div class="fixed lg:hidden flex bottom-0 w-full">
<div class="flex items-center justify-between w-full border-t border-gray-200 p-2">
<div class="px-8">
<a href="#" class="text-2xl text-blue-600">
<i class="ms-Icon ms-Icon--Mail"></i>
</a>
</div>
<div class="px-8">
<a href="#" class="text-2xl text-gray-700">
<i class="ms-Icon ms-Icon--Calendar"></i>
</a>
</div>
<div class="px-8">
<a href="#" class="text-2xl text-gray-700">
<i class="ms-Icon ms-Icon--People"></i>
</a>
</div>
</div>
</div>
</body>
*:focus {
outline: none !important;
}
.w-32px {
width: 32px;
height: 32px;
}
Also see: Tab Triggers