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 URL's 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 it's URL and the proper URL extention.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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="site-outer">
<div class="site-inner" id="site">
<nav class="menu">
<ul class="menu-hamburger" id="menu">
<li></li>
<li></li>
<li></li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div class="hero" style="background-image: url('https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-250583.jpg');">
<div class="hero-header">
<div class="inner">
<header class="header header-w">
<h1 class="h1-w">Web & Strategies</h1>
</header>
<p>
<button class="button button-transparent-white" data-toggle="modal" data-target="#modal-login">Login</button>
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="row">
<div class="small-hero small-hero-turqouise">
<h1 class="text-center">We love three things</h1>
<h2 class="text-center">Web, Strategies & Coffee</h2>
</div>
</div>
</div>
</div>
<div class="row padding">
<div class="col-md-8 col-md-offset-2 col-sm-12">
<div class="row">
<div class="col-md-4 col-sm-4 text-center three-p">
<h1><i class="fa fa-desktop"></i></h1>
<h2>Web</h2>
<p class="text-left">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen
book. Bla bla bla bla bla... Lorem Ipsum strategy hello world.
</p>
<div class="row">
<div class="col-md-12">
<button class="button button-transparent-turqouise">Read more <i class="fa fa-chevron-right"></i></button>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4 text-center three-p">
<h1><i class="fa fa-line-chart"></i></h1>
<h2>Strategies</h2>
<p class="text-left">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia,
looked up one of the more obscure Latin words, consectetur.</p>
<div class="row">
<div class="col-md-12">
<button class="button button-transparent-turqouise">Read more <i class="fa fa-chevron-right"></i></button>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4 text-center three-p">
<h1><i class="fa fa-coffee"></i></h1>
<h2>Coffee</h2>
<p class="text-left">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using
'Content here, content here', making it look like readable English.</p>
<div class="row">
<div class="col-md-12">
<button class="button button-transparent-turqouise">Read more <i class="fa fa-chevron-right"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="row">
<div class="small-hero small-hero-turqouise">
<h1 class="text-center">Two priorities</h1>
<h2 class="text-center">Speed & functionality</h2>
</div>
</div>
</div>
</div>
<div class="row padding">
<div class="col-md-8 col-md-offset-2 col-sm-12">
<div class="row">
<div class="col-md-5 col-md-offset-1 col-sm-6 text-center three-p">
<h1><i class="fa fa-fighter-jet"></i></h1>
<h2>Speed</h2>
<p class="text-left">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using
'Content here, content here', making it look like readable English.</p>
<div class="row">
<div class="col-md-12">
<button class="button button-turqouise">Read more <i class="fa fa-chevron-right"></i></button>
</div>
</div>
</div>
<div class="col-md-5 col-sm-6 text-center three-p">
<h1><i class="fa fa-cogs"></i></h1>
<h2>Functionality</h2>
<p class="text-left">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen
book. Bla bla bla bla bla... Lorem Ipsum strategy hello world.
</p>
<div class="row">
<div class="col-md-12">
<button class="button button-turqouise">Read more <i class="fa fa-chevron-right"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<aside class="modal fade" id="modal-terms">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header modal-header-turqouise">
<h2 class="text-center">Terms and conditions</h2></div>
<div class="modal-body clearfix">
<p>
Lorem Ipsum är en utfyllnadstext från tryck- och förlagsindustrin. Lorem ipsum har varit standard ända sedan 1500-talet, när en okänd boksättare tog att antal bokstäver och blandade dem för att göra ett provexemplar av en bok. Lorem ipsum har inte bara
överlevt fem århundraden, utan även övergången till elektronisk typografi utan större förändringar. Det blev allmänt känt på 1960-talet i samband med lanseringen av Letraset-ark med avsnitt av Lorem Ipsum, och senare med mjukvaror som Aldus
PageMaker.
</p>
<p>
<button data-dismiss="modal" class="button button-turqouise">Got it</button>
</p>
<p>
<button data-dismiss="modal" class="button button-transparent-turqouise">I decline</button>
</p>
</div>
</div>
</div>
</aside>
<aside class="modal fade" id="modal-login">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header modal-header-turqouise">
<h2 class="text-center">Login</h2>
</div>
<div class="modal-body clearfix">
<div class="form">
<form class="form-holder">
<span class="form-icon form-icon-turqouise">
<i class="fa fa-envelope"></i>
<input type="text" placeholder="E-mail" class="form-input form-input-turqouise" />
</span>
<span class="form-icon form-icon-turqouise">
<i class="fa fa-key"></i>
<input type="password" placeholder="Password" class="form-input form-input-turqouise" />
</span>
<p>
<button type="submit" class="button button-turqouise">Login</button>
</p>
<p>
<button data-dismiss="modal" class="button button-transparent-turqouise">Cancel</button>
</p>
<p class="pull-right"><a href="#" class="link link-turqouise">Forgot password?</a></p>
</form>
</div>
</div>
</div>
</div>
</aside>
<aside class="navigation" id="navigation">
<div class="login login-turqouise" id="login"><a href="#">Create account</a></div>
<ul class="navigation-menu">
<li><a href="#" class="active"><span class="icon-circle"><i class="fa fa-home"></i></span> Home</a></li>
<li><a href="#"><span class="icon-circle"><i class="fa fa-line-chart"></i></span> Dashboards</a></li>
<li><a href="#"><span class="icon-circle"><i class="fa fa-table"></i></span> Tables</a></li>
<li><a href="#"><span class="icon-circle"><i class="fa fa-user"></i></span> Profile</a></li>
<li><a href="#"><span class="icon-circle"><i class="fa fa-cog"></i></span> Settings</a></li>
</ul>
</aside>
<aside class="navigation" id="login-form">
<div class="login login-turqouise"><a href="#">Sign up</a></div>
<ul class="navigation-menu">
<li>
<div class="form">
<form class="form-holder">
<span class="form-icon form-icon-turqouise">
<i class="fa fa-user"></i>
<input type="text" placeholder="First- and last name" class="form-input form-input-turqouise" />
</span>
<span class="form-icon form-icon-turqouise">
<i class="fa fa-envelope"></i>
<input type="text" placeholder="name@example.com" class="form-input form-input-turqouise" />
</span>
<span class="form-icon form-icon-turqouise">
<i class="fa fa-key"></i>
<input type="password" placeholder="Password" class="form-input form-input-turqouise" />
</span>
<p>
<button type="submit" class="button button-turqouise">Sign up</button>
</p>
<p>
<button class="button button-transparent-turqouise" data-cancel="#cancel" data-toggle="modal" data-target="#modal-login">Login</button>
</p>
<p class="text-center"><a href="#" data-cancel="#cancel" class="link link-turqouise">Cancel</a></p>
<p class="text-center"><a href="#" data-toggle="modal" data-target="#modal-terms">Terms and conditions</a></p>
</form>
</div>
</li>
</ul>
</aside>
*, *:before, *:after {
box-sizing: border-box;
&::-webkit-scrollbar { display: none; }
}
@import url(https://fonts.googleapis.com/css?family=Raleway:400,300);
@import: "font-awesome";
@black: #333;
@white: #FFF;
@orange: #E49723;
@turqouise: #84BABA;
@turqouise-lighten: lighten(@turqouise, 10%);
@blue: #3892D2;
@s: 768px;
@m: 992px;
@l: 1200px;
body {
margin: 0 auto;
padding: 0;
background-color: @white;
font-family: "Raleway", sans-serif;
font-weight: 400;
}
.site-outer {
overflow-x: hidden;
width: 100%;
height: 100%;
.site-inner {
transition: all 350ms ease-in-out;
&.slide-right {
transform: translateX(250px);
}
}
}
.menu {
position: absolute;
top: 0;
left: 0;
margin: 15px;
z-index: 2999;
&-hamburger {
width: 50px;
height: 50px;
border-radius: 10px;
padding: 11px 7px;
list-style: none;
border: 3px solid @black;
cursor: pointer;
transition: all 150ms ease-in-out;
& li {
margin: 0 0 7px;
width: 30px;
height: 3px;
background-color: @black;
transition: all 150ms ease-in-out;
}
&:hover {
border-radius: 100%;
animation: spin 350ms ease;
& li {
&:nth-child(1) {
transform: rotate(-45deg) translate3d(-3px, 2px, 0);
width: 15px;
}
&:nth-child(3) {
transform: rotate(45deg) translate3d(-3px, -2px, 0);
width: 15px;
}
}
}
&.active {
border-radius: 100%;
&:hover {
animation-play-state: paused;
& li {
width: 30px;
}
}
& li {
&:nth-child(1) {
transform: rotate(-45deg) translate3d(-7px, 7px, 0);
width: 30px;
}
&:nth-child(2) {
display: none;
}
&:nth-child(3) {
transform: rotate(45deg);
width: 30px;
}
}
}
}
}
.hero {
width: 100%;
height: 100vh;
min-height: 100%;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
&-header {
display: table;
height: 50vh;
margin: 0 auto;
min-height: 100%;
.inner {
display: table-cell;
vertical-align: middle;
padding: 1.5rem;
header {
padding: 1rem;
margin-bottom: 1rem;
&:before,
&:after {
content: "";
display: block;
height: 1px;
}
&.header {
background-color: @white;
opacity: .6;
mix-blend-mode: lighten;
text-align: center;
h1 {
margin: 0;
font-weight: 300;
font-size: 8rem;
text-transform: uppercase;
color: initial;
@media (max-width: @s) {
& {
font-size: 2.6rem;
}
}
}
}
}
}
}
}
.small-hero {
padding: 4rem;
&-turqouise {
background-color: @turqouise;
& h1 {
color: @white;
}
& h2 {
color: @white;
}
}
& h1 {
font-size: 8rem;
}
& h2 {
font-size: 4rem;
}
@media (max-width: @s) {
& {
& h1 {
font-size: 2.5rem;
}
& h2 {
font-size: 1.8rem;
}
}
}
}
.three-p {
& h1 {
font-size: 4.5rem;
}
& h2 {
font-size: 3.5rem;
color: @turqouise;
}
}
.navigation {
position: fixed;
top: 0;
left: 0;
width: 250px;
height: 100%;
margin: 0;
transform: translateX(-250px);
transition: all 350ms ease-in-out;
background-color: @black;
overflow: auto;
&-white {
background-color: @white;
}
&.slide-right {
transform: translateX(0);
}
.login {
padding: 16px;
text-align: center;
width: 100%;
transition: all 250ms ease;
cursor: pointer;
&-turqouise {
background-color: @turqouise;
}
&-blue {
background-color: @blue;
}
& a {
text-decoration: none;
font-size: 20px;
color: @white;
text-transform: uppercase;
}
}
&-menu {
list-style: none;
padding: 0;
margin: 0;
height: 100%;
& li {
width: 100%;
display: block;
& a {
display: block;
padding: 13px 16px;
position: relative;
white-space: nowrap;
text-decoration: none;
text-transform: uppercase;
width: 100%;
color: lighten(@black, 20%);
transition: all 250ms ease;
outline: none;
& > .icon-circle {
color: inherit;
font-size: 13px;
width: 35px;
height: 35px;
border-radius: 50%;
background-color: darken(@black, 5%);
line-height: 29px;
margin-right: 7px;
text-align: center;
padding: 6px 8px;
}
&:hover {
color: @white;
}
&.active {
background-color: lighten(@black, 3%);
color: @turqouise;
& > .icon-circle {
color: inherit;
}
}
}
}
}
}
.wrapper {
width: 100%;
margin: 10vh auto;
height: 500px;
position: relative;
overflow: hidden;
background-color: @white;
border-radius: 6px;
padding: 120px 0;
.upper {
position: absolute;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 50%;
background-color: @black;
z-index: 3;
transition: all 350ms ease;
padding: 40px;
&.on {
transform: translate3d(-50%, -80%, 0);
box-shadow: -3px 3px 6px -2px rgba(0, 0, 0, 0.8);
}
.login {
position: relative;
top: 80%;
width: 130px;
height: 130px;
margin: 0 auto;
background-color: @turqouise;
z-index: 4;
border-radius: 100%;
border: 3px solid @turqouise;
box-shadow: -3px 3px 6px -2px rgba(0, 0, 0, 0.8);
cursor: pointer;
transition: all 500ms ease;
&:hover {
border-color: @turqouise-lighten;
background-color: @turqouise-lighten;
}
&-text {
width: 120px;
height: 120px;
border-radius: 100%;
text-align: center;
& > h2 {
color: @white;
text-transform: uppercase;
line-height: 120px;
margin: 0;
font-size: 90px;
}
}
}
}
.lower {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 50%;
background-color: @black;
z-index: 2;
transition: all 350ms ease;
padding: 40px;
&-holder {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
padding: 15px;
p {
color: @white;
margin: 0 auto;
display: inline;
&.float-left {
float: left;
}
&.float-right {
float: right;
}
& a {
outline: none;
}
}
}
&.on {
transform: translate3d(50%, 80%, 0);
box-shadow: -3px 3px 6px -2px rgba(0, 0, 0, 0.8);
}
}
}
a.link {
color: initial;
text-decoration: none;
&-blue {
color: @blue;
&:active,
&:hover,
&:focus {
color: @blue;
}
}
&-white {
color: @white;
&:active,
&:hover,
&:focus {
color: @white;
}
}
&-turqouise {
color: @turqouise;
&:active,
&:hover,
&:focus {
color: @turqouise;
}
}
}
.button {
outline: none;
border: 2px solid @white;
padding: 12px 16px;
width: 100%;
white-space: nowrap;
font-size: 12px;
text-transform: uppercase;
font-weight: 400;
vertical-align: middle;
line-height: 18px;
text-align: center;
text-decoration: none;
color: @black;
background-color: transparent;
border-radius: 16px;
cursor: pointer;
transition: all 250ms ease;
margin-bottom: 2rem;
&-transparent-white {
border-color: @white;
color: @white;
}
&-transparent-turqouise {
border-color: @turqouise;
color: @turqouise;
}
&-turqouise {
border-color: @turqouise;
background-color: @turqouise;
color: @white;
&:hover {
border-color: @turqouise-lighten;
background-color: @turqouise-lighten;
}
}
& > i {
transition: all 550ms ease;
transform: translateX(0) rotate(0deg);
}
&:hover {
& > i {
transform: translateX(1rem) rotate(360deg);
}
}
}
.push {
margin: 25% 0;
}
.form {
position: relative;
width: 100%;
&-holder {
margin: 0 auto;
padding: 15px;
.form-icon {
position: relative;
font-size: 16px;
&-turqouise {
& > i {
background-color: @turqouise;
color: @white;
}
}
& > i {
position: absolute;
top: 0;
left: 0;
line-height: 49px;
margin: 0;
display: block;
z-index: 2;
padding: 0 9px;
width: 35px;
}
}
.form-input {
display: block;
margin-bottom: 20px;
border: 0;
outline: none;
background-color: transparent;
border: 3px solid @turqouise;
padding: 11px 0 11px 45px;
font-size: 16px;
width: 100%;
color: @turqouise;
transition: all 250ms ease-in-out;
}
}
}
.modal-header {
border-radius: 6px;
&-turqouise {
background-color: @turqouise;
}
& > h2 {
color: @white;
}
}
.padding {
padding: 4rem 0;
}
&::-webkit-input-placeholder { color: @turqouise; }
&:-moz-placeholder { color: @turqouise; }
&::-moz-placeholder { color: @turqouise; }
&:-ms-input-placeholder { color: @turqouise; }
@-webkit-keyframes spin {
from {
transform: rotate(0deg);
} to {
transform: rotate(360deg);
}
}
(function() {
var $login = $(".login"),
$cancel = $("[data-cancel]"),
$loginform = $("#login-form"),
$navigation = $("#navigation"),
$site = $("#site"),
$menu = $("#menu");
$login.on("click", function() {
var $this = $(this);
if ($this.hasClass("active")) {
$this.removeClass("active");
} else {
$this.addClass("active");
$loginform.addClass("slide-right");
}
});
$cancel.on("click", function(e) {
e.preventDefault();
if ($login.hasClass("active")) {
$login.removeClass("active");
$loginform.removeClass("slide-right");
}
});
}.call(this));
(function() {
var $menu = $("#menu"),
$navigation = $("#navigation"),
$loginform = $("#login-form"),
$site = $("#site");
$menu.on("click", function() {
var $this = $(this);
if ($this.hasClass("active")) {
$this.removeClass("active");
$navigation.removeClass("slide-right");
$loginform.removeClass("slide-right");
$site.removeClass("slide-right");
} else {
$this.addClass("active");
$navigation.addClass("slide-right");
$site.addClass("slide-right");
}
});
}.call(this));
(function() {
var $input = $(".form-input");
$input.on("focusin", function() {
var $this = $(this);
$this.css({
"padding-left": "8px"
});
$this.parent().find("i").fadeOut(250);
});
$input.on("focusout", function() {
var $this = $(this);
$this.css({
"padding-left": "45px"
});
$this.parent().find("i").fadeIn(250);
});
}.call(this));
(function() {
$(".three-p > p").matchHeight({
byRow: true,
property: "height",
target: null,
remove: false
});
}.call(this));
Also see: Tab Triggers