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.
<header class="middle">
<div id="icon">
<a href="#">
<img src="https://i.ibb.co/R0JgrdJ/g-icon.png" alt="" />
</a>
</div><div id="search" class="middle">
<input type="text" placeholder="Search"/>
<span id="submit" class="middle">
<i class="material-icons"></i><span class="taille"></span>
</span><span class="taille"></span>
</div><div id="right" class="middle">
<span class="middle">
<i class="material-icons"></i><i class="material-icons"></i><div id="avatar">
<img src="https://therolf.fr/img/therolf.jpg" alt="avatar" />
</div></span><span class="taille"></span>
</div>
</header>
<div id="content">
<div class="element" id="list">
<div class="options middle">
<div id="title">
Gmail
</div><div>
<input type="checkbox" id="selectall" class="none" />
<label for="selectall"></label>
</div><div>
<i class="material-icons"></i>
</div><div class="middle"><span></span>More<span><i class="material-icons"></i></span></div>
</div>
</div>
<div id="left" class="element">
<ul>
<li class="active">Inbox</li>
<li>Starred</li>
<li>Sent Mail</li>
<li><b>Drafts (1)</b></li>
<li>More</li>
</ul>
</div><div id="mails">
<div class="loremhidden"><!-- this is an hidden part. it is to detect leftovers content -->Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc blandit ex ultricies nisi tempus bibendum a congue quam. Fusce et pretium nibh, a semper enim. Proin accumsan sollicitudin ante et faucibus. Aliquam lacinia ultrices leo vel accumsan. In tincidunt fringilla tortor, ut ultricies odio laoreet in. Nullam consequat placerat turpis ac hendrerit. Curabitur lacinia euismod posuere. Suspendisse ultricies urna in leo pellentesque, sit amet consequat ante hendrerit. Etiam semper pellentesque risus. Praesent vitae tincidunt nunc.</div>
<div id="nav" class="element">
<div class="middle active">
<i class="material-icons"></i><span>Primary</span><span class="taille"></span>
</div><div class="middle">
<i class="material-icons"></i><span>Social</span><span class="taille"></span>
</div><div class="middle">
<i class="material-icons"></i><span>Promotions</span><span class="taille"></span>
</div>
</div>
<div class="mail element middle notread">
<div class="leftpart middle"><div class="thumb"><img src="https://i.pravatar.cc/150?img=1" alt="" /></div>
<span><b>Mary Jones</b></span></div>
<div class="centerpart middle">
<div><b>Weekly session</b> - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris velit eros, tempor at lectus nec, malesuada semper enim. Vivamus elementum diam sed metus fringilla condimentum. Vivamus condimentum nec justo ac dignissim. Sed vitae consectetur eros. Pellentesque pretium leo ut turpis luctus, id congue nisi aliquam. Curabitur efficitur dolor sed dictum dapibus. Cras vitae viverra ipsum, non sagittis lacus. Suspendisse commodo dolor ac dapibus tempor. Vestibulum sagittis neque ut finibus mollis. Nam venenatis ullamcorper arcu, id laoreet libero malesuada non.</div><span class="taille"></span>
</div>
<span class="date middle"><span>Nov 3</span><span class="taille"></span></span>
</div>
<div class="mail element middle">
<div class="leftpart middle"><div class="thumb"><img src="https://i.pravatar.cc/150?img=3" alt="" /></div>
<span>Bob Dylan</span></div>
<div class="centerpart middle">
<div><span>Next party ?</span> - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris velit eros, tempor at lectus nec, malesuada semper enim. Vivamus elementum diam sed metus fringilla condimentum. Vivamus condimentum nec justo ac dignissim. Sed vitae consectetur eros. Pellentesque pretium leo ut turpis luctus, id congue nisi aliquam. Curabitur efficitur dolor sed dictum dapibus. Cras vitae viverra ipsum, non sagittis lacus. Suspendisse commodo dolor ac dapibus tempor. Vestibulum sagittis neque ut finibus mollis. Nam venenatis ullamcorper arcu, id laoreet libero malesuada non.</div><span class="taille"></span>
</div>
<span class="date middle"><span>Nov 3</span><span class="taille"></span></span>
</div>
<div class="mail element middle">
<div class="leftpart middle"><div class="thumb">M</div>
<span>Mylan Sware</span></div>
<div class="centerpart middle">
<div><span>What you asked me</span> - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris velit eros, tempor at lectus nec, malesuada semper enim. Vivamus elementum diam sed metus fringilla condimentum. Vivamus condimentum nec justo ac dignissim. Sed vitae consectetur eros. Pellentesque pretium leo ut turpis luctus, id congue nisi aliquam. Curabitur efficitur dolor sed dictum dapibus. Cras vitae viverra ipsum, non sagittis lacus. Suspendisse commodo dolor ac dapibus tempor. Vestibulum sagittis neque ut finibus mollis. Nam venenatis ullamcorper arcu, id laoreet libero malesuada non.</div><span class="taille"></span>
</div>
<span class="date middle"><span>Nov 3</span><span class="taille"></span></span>
</div>
<div class="mail element middle">
<div class="leftpart middle"><div class="thumb"><img src="https://i.pravatar.cc/150?img=5" alt="" /></div>
<span>Suzanne Carol</span></div>
<div class="centerpart middle">
<div><span>You miss me</span> - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris velit eros, tempor at lectus nec, malesuada semper enim. Vivamus elementum diam sed metus fringilla condimentum. Vivamus condimentum nec justo ac dignissim. Sed vitae consectetur eros. Pellentesque pretium leo ut turpis luctus, id congue nisi aliquam. Curabitur efficitur dolor sed dictum dapibus. Cras vitae viverra ipsum, non sagittis lacus. Suspendisse commodo dolor ac dapibus tempor. Vestibulum sagittis neque ut finibus mollis. Nam venenatis ullamcorper arcu, id laoreet libero malesuada non.</div><span class="taille"></span>
</div>
<span class="date middle"><span>Nov 3</span><span class="taille"></span></span>
</div>
</div>
</div>
body {
background: #dad7d7;
background-size: cover;
background-position: center;
background-attachment: fixed;
}
header {
height: 60px;
position: relative;
background-color: #b53120;
color: #fff;
-moz-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.4);
-webkit-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.4);
-o-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.4);
box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.4);
filter:progid:DXImageTransform.Microsoft.Shadow(color=#00000033), Direction=90, Strength=5);
}
header #icon {
height: 100%;
background: #fafafa;
width: 80px;
}
header #search {
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
width: 30%;
margin-left: 150px;
position: relative;
padding-right: 54px;
}
header #search input {
padding-left: 15px;
font-size: inherit;
width: 100%;
height: 100%;
border: 0px none;
background: none;
color: inherit;
}
header #search #submit {
position: absolute;
right: 0;
top: 0;
bottom: 0;
padding: 0 15px;
}
header #right {
position: absolute;
right: 0;
top: 0;
bottom: 0;
padding: 0 30px;
background-color: #fff;
color: #242424;
}
header #right i {
padding: 0 20px 0 0;
}
header #right #avatar {
height: 40px;
width: 40px;
border-radius: 50%;
overflow: hidden;
background-color: #2f2b2b;
}
#content {
padding: 10px;
}
#content #left {
width: 210px;
float: left;
padding: 0;
background: none;
}
#left ul li {
padding: 6px 20px;
cursor: pointer;
background: rgba(255,255,255,.6);
}
#left li b {
font-weight: 600;
}
#content #mails {
overflow: hidden;
padding: 0 0 0 10px;
}
.loremhidden {
height: 0px;
overflow: hidden;
}
#mails #nav {
padding: 0;
color: #242424;
background: none;
}
#nav div {
height: 100%;
padding: 6px 10px;
display: inline-block;
width: 240px;
max-width: 33.33%;
cursor: pointer;
background: rgba(255,255,255,.6);
}
#left ul li.active, #nav div.active, #left ul li:hover {
background: #fff;
}
#nav div i {
margin-right: 10px;
}
.cb {
background: red;
}
#list {
padding: 5px 20px;
margin-bottom: 10px;
}
#list #title {
width: 210px;
color: #b53120;
font-weight: 600;
margin-right: 0;
}
.options label {
height: 20px;
width: 20px;
background: #ccc;
border-radius: 3px;
display: block;
}
.options input:checked + label {
background: #b53120;
}
.options div {
margin-right: 20px;
cursor: pointer;
}
.options div i {
display: block;
}
#mails .mail {
background: rgba(255,255,255,.6);
padding: 7px 20px;
}
#mails .mail.notread {
background: #fff;
border-bottom: 1px solid #c9c9c9;
}
.mail .thumb {
height: 40px;
width: 40px;
border-radius: 50%;
overflow: hidden;
background: #ccc;
margin-right: 10px;
text-align: center;
line-height: 40px;
color: #fff;
}
.mail .leftpart {
width: 220px;
}
.mail .centerpart {
overflow: hidden;
width: 100%;
padding-left: 220px;
padding-right: 80px;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.mail .centerpart div {
text-overflow: ellipsis;
overflow: hidden;
height: 20px;
line-height: 20px;
color: #666;
word-break: break-all;
}
.mail .centerpart div b, .mail .centerpart div span {
color: #000;
}
.mail .date {
position: absolute;
right: 0;
top: 0;
bottom: 0;
padding-right: 20px;
}
body {
background-image: url(https://therolf.fr/img/landscape-automn.jpg);
}
Also see: Tab Triggers