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="container app">
<aside class="sidebar">
<h1 class="logo">
<a href="#">Simpl<strong>est</strong></a>
</h1>
<nav class="main-nav">
<ul>
<li><a href="#">Profile</a></li>
<li class="active">
<a href="#">Email</a><br />
<a href="#" class="btn btn-primary">Compose new</a>
<ul>
<li class="active"><a href="#">Inbox <span class="btn btn-primary">25</span></a></li>
<li><a href="#">Drafts</a></li>
<li><a href="#">Sent</a></li>
<li><a href="#">Trash</a></li>
<li><a href="#">Junk Mail</a></li>
</ul>
<ul class="labels">
<li><a href="#">Clients <span class="btn btn-primary label"></span></a></li>
<li><a href="#">Friends <span class="btn btn-primary label"></span></a></li>
<li><a href="#">Family <span class="btn btn-primary label"></span></a></li>
<li><a href="#">Dribbble <span class="btn btn-primary label"></span></a></li>
</ul>
</li>
<li><a href="#">Docs</a></li>
<li><a href="#">Stats</a></li>
</ul>
</nav>
</aside>
<div class="main">
<header class="header">
<form action="">
<input type="search" name="s" placeholder="Search on simplest" />
</form>
<nav class="nav-settings">
<ul>
<li><a href="#">Gregoire Vella</a></li>
<li><a href="#" class="icon icon-gear"></a></li>
</ul>
</nav>
<div class="clr"></div>
</header>
<div class="container">
<div class="messages">
<h1>Inbox <span class="icon icon-arrow-down"></span></h1>
<form action="">
<input type="search" class="search" placeholder="Search Inbox" />
</form>
<ul class="message-list">
<li class="new">
<input type="checkbox" />
<div class="preview">
<h3>Sarach Connor <small>Jul 15</small></h3>
<p><strong>I've been hunted - </strong>A crazing robot ...</p>
</div>
</li>
<li class="active">
<input type="checkbox" />
<div class="preview">
<h3>Jeremy Clarkson <small>Jul 15</small></h3>
<p>The brand new season of Top Gear</p>
</div>
</li>
<li class="">
<input type="checkbox" />
<div class="preview">
<h3>Eureka.com <small>Jul 14</small></h3>
<p><strong>Interface design - </strong>Hi Greg ...</p>
</div>
</li>
<li class="">
<input type="checkbox" />
<div class="preview">
<h3>Jeremy Legrand <small>Jul 13</small></h3>
<p><strong>CSS Responsive - </strong>Here is my hack to ...</p>
</div>
</li>
<li class="">
<input type="checkbox" />
<div class="preview">
<h3>Noe Vella <small>Jul 13</small></h3>
<p><strong>Personal resume - </strong>Hi Greg, as expected ...</p>
</div>
</li>
<li class="">
<input type="checkbox" />
<div class="preview">
<h3>Dribbble <small>Jul 12</small></h3>
<p><strong>Thank you for purchaseing a pro account</strong></p>
</div>
</li>
<li class="">
<input type="checkbox" />
<div class="preview">
<h3>Dribbble <small>Jul 12</small></h3>
<p><strong>Work inquiry from Andy Blast - </strong>the foll...</p>
</div>
</li>
<li class="">
<input type="checkbox" />
<div class="preview">
<h3>Behance <small>Jul 12</small></h3>
<p><strong>Raj sent you a direct message - </strong></p>
</div>
</li>
<li class="new">
<input type="checkbox" />
<div class="preview">
<h3>Behance <small>Jul 12</small></h3>
<p><strong>Raj sent you a direct message - </strong></p>
</div>
</li>
<li class="">
<input type="checkbox" />
<div class="preview">
<h3>Dribbble <small>Jul 11</small></h3>
<p><strong>Peter Avey is now following you - </strong>Hi ...</p>
</div>
</li>
</ul>
</div>
<section class="message">
<h2><span class="icon icon-star-large"></span> The brand new season of Top Gear <span class="icon icon-reply-large"></span><span class="icon icon-delete-large"></span></h2>
<div class="meta-data">
<p>
<img src="http://placehold.it/40x40" class="avatar" alt="" />
Jeremy Clarkson to <span class="user">me</span>
<span class="date">July 15, 2013</span>
</p>
</div>
<div class="body">
<p>Hi Greg,</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam modi possimus dignissimos maxime ipsa unde voluptatum consectetur harum debitis dolorum quas quibusdam vero iusto ducimus blanditiis. Enim autem illo praesentium est quis ab voluptate sequi quia magnam deleniti vero dicta iste. Harum velit asperiores expedita inventore error nulla eius nostrum voluptas aspernatur at quia eaque ipsa deserunt quas doloribus totam incidunt mollitia iure! Libero laudantium nobis necessitatibus veniam autem molestias distinctio voluptas quos aliquam vitae. Consequuntur adipisci natus hic sed rerum dolore cumque numquam illum rem at quaerat reprehenderit iste quis maiores fuga voluptates delectus suscipit dicta nulla itaque placeat.</p>
<p>Cheers</p>
</div>
<div class="action">
<ul class="options">
<li><a href="#" class="active">Answering</a></li>
<li><a href="#">Forward</a></li>
<div class="clr"></div>
</ul>
<div class="textarea">
<textarea name="r">Hello Jeremy,
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sit qui impedit magni fuga velit nobis quas fugit odio voluptas voluptates odit animi quos nam dolorem harum molestiae culpa sint rem ad esse laboriosam vero quod molestias porro ea dolores eligendi!
</textarea>
<div class="fileupload container">
<span class="fileinfo">My file enclosed.pdf</span>
<div class="progress">
<div class="bar">65%</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
@import "compass/css3";
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
$accent: #44c4e7;
$sidebarColor: #34393d;
$hightlight: #fd9162;
* { box-sizing: border-box; }
body { font-family: 'Open Sans', sans-serif; }
.clr { clear: both; }
a {
text-decoration: none;
}
.btn {
border-radius: 4px;
padding: 6px 10px;
text-align: center;
text-shadow: none;
color: #fff;
background: #fff;
&.btn-primary {
background: $accent;
}
}
.container {
display: flex;
width: 100%;
height: 100%;
}
.sidebar {
width: 250px;
background: $sidebarColor;
order: 1;
flex-flow: column;
color: #fff;
a {
color: #fff;
}
h1 {
font-weight: 400;
background: darken($accent, 15%);
line-height: 80px;
margin: 0;
padding: 0 30px;
}
.main-nav {
margin: 30px 0;
> ul {
list-style: none;
margin: 0;
padding: 0;
> li {
transition: background-color .3s ease;
&.active, &:hover {
background: lighten($sidebarColor,5%);
}
> a {
padding: 20px 30px;
display: block;
color: #999;
font-weight: 700;
text-shadow: 1px 1px 2px rgba(0,0,0,.3);
}
> .btn {
display: block;
color: #fff;
text-shadow: none;
margin: 10px 30px;
padding: 10px;
font-weight: 400;
}
> ul {
list-style: none;
margin: 0;
padding: 10px 0;
&.labels {
border-top: 1px solid #555;
margin-top: 20px;
}
> li {
transition: background-color .3s ease;
padding: 10px 30px;
&.active, &:hover {
background: lighten($sidebarColor,10%);
}
.btn {
font-size: .875rem;
padding: 5px;
float: right;
position: relative;
top: -4px;
}
.label {
width: 20px; height: 20px; display: inline-block;
top: 0;
}
a {
color: #999;
}
}
}
}
}
}
}
.main {
-webkit-flex: 1;
order: 2;
background: #f5f5f5;
.header {
background: $accent;
min-height: 80px;
form {
padding: 20px;
display: inline-block;
input[type="search"]{
background: darken($accent,15%);
border:none;
border-radius: 3px;
line-height: 40px;
width: 500px;
padding: 0 10px;
outline: none;
}
input[type="search"]::-webkit-input-placeholder { color: #fff; }
}
ul {
list-style: none;
margin: 0;
padding: 0;
}
.nav-settings {
float: right;
line-height: 80px;
border-left: 1px solid darken($accent,10%);
li {
display: inline-block;
&:hover {
background: darken($accent,5%);
}
a {
padding: 0 20px;
color: #fff;
display: inline-block;
}
}
}
}
}
.messages {
order: 1;
width: 400px;
background: #fff;
border-right: 1px solid #DDD;
h1 {
margin: 0;
padding: 20px;
font-weight: 400;
color: #777;
border-bottom: 1px solid #DDD;
}
form {
padding: 20px;
background: #FCFCFC;
input[type="search"] {
width: 100%;
border-radius: 4px;
border: 1px solid #ddd;
padding: 10px;
box-sizing: border-box;
outline: none;
}
}
.message-list {
padding: 0;
margin: 0;
list-style: none;
border-bottom: 1px solid #ddd;
li {
background: #F8F6F4;
transition: background-color .3s ease;
border-top: 1px solid rgba(0,0,0,0.1);
border-right: 3px solid darken($accent,10%);
padding: 10px 20px;
display: flex;
cursor: pointer;
input[type="checkbox"] {
appearance: none;
cursor: pointer;
margin: 5px 10px 0 0;
order: 1;
width: 15px;
height: 15px;
background: #fff;
border: 1px solid #ddd;
border-radius: 3px;
&:checked {
background: #EFEFEF;
}
}
.preview {
flex: 1;
order: 2;
h3 {
margin: 0;
font-weight: 400;
color: #333;
small {
float: right;
color: #AAA;
font-size: .8125rem;
}
}
p {
color: #888;
margin: 5px 0;
}
}
&:hover {
background: #fff;
}
&.active {
background: $hightlight;
border-right: 3px solid rgba(0,0,0,0.1);
.preview {
h3, h3 small, p { color: #fff; }
}
}
&.new {
background: #fff;
border-right: 3px solid $accent;
}
}
}
}
.message {
-webkit-flex: 1;
order: 2;
background: #fff;
h2 {
margin: 0;
padding: 20px 30px;
font-weight: 400;
}
.meta-data {
margin: 10px 30px;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
line-height: 50px;
color: #888;
.user {
color: $hightlight;
}
img {
display: inline;
vertical-align: middle;
margin-right: 20px;
border-radius: 3px;
}
.date {
float: right;
color: #aaa;
}
}
.body {
padding: 20px 30px;
}
.action {
background: #fcfcfc;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
padding: 20px 30px;
.options {
list-style: none;
margin: 0;
padding: 0;
li {
float: left;
&:first-child {
border-right: 1px solid #ddd;
a {
padding-left: 0;
}
}
a {
color: #888;
padding: 0 10px;
&.active {
color: #333;
}
}
}
}
.textarea {
background: #fff;
padding: 10px;
border: 1px solid #ddd;
position: relative;
margin: 20px 0;
&:before {
content: '';
display: block;
border: 10px solid transparent;
border-bottom: 10px solid #FFF;
position: absolute;
top: -19px;
left: 25px;
-webkit-filter: drop-shadow(0 -1px 0 #ddd);
}
textarea {
width: 100%;
min-height: 300px;
appearance: none;
border: none;
resize: none;
outline: none;
margin-bottom: 50px;
}
.fileupload {
background: #FCFCFC;
border: 1px solid #ddd;
padding: 10px;
color: #888;
justify-content: space-between;
.fileinfo {
flex: 1;
}
.progress {
width: 80%;
border: 1px solid #ddd;
background: #fff;
padding: 2px;
.bar {
background: $accent;
width: 65%;
text-align: right;
color: #fff;
padding: 3px;
font-size: .75rem;
}
}
}
}
}
}
Also see: Tab Triggers