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.
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="responsive-nav.css">
<script src="responsive-nav.js"></script>
<section id=showcase>
<nav class=navbar>
<p class=logo><a href=#>My<span>Site</span></a></p>
<ul>
<li><a class=menu href=#>Support</a></li>
<li><a class=menu href=#>Smack it</a></li>
<li><a class=menu href=#>About</a></li>
</ul>
<a class=link href=#>Sign up</a>
</nav>
<div class=container>
<div class=title>
<h1><span class=under>Not</span></br>another</br>boring page</h1>
</div>
<a hreft=# class=getstarted type="submit">Get started for free</a>
</div>
</section>
<div class=tevuks>
<section id=keep>
<h2>Lorem ipsum dolor</br>sit amet consectetur</h2>
</section>
<section id=yours>
<div class=container>
<h2>Your stuff</h2>
<div class=gridas>
<div class=item>
<i class="fas fa-anchor fa-4x"></i>
<h3>Lorem ipsum</h3>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit perel</p>
</div>
<div class=item>
<i class="fas fa-balance-scale fa-4x"></i>
<h3>Lorem ipsum</h3>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit perel</p>
</div>
<div class=item>
<i class="fas fa-flask fa-4x"></i>
<h3>Lorem ipsum</h3>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit perel</p>
</div>
</div>
</div>
</section>
</div>
<section id=how>
<div class=container>
<div class=image></div>
<h2>How it works</h2>
<div class=gridasc>
<div class=item>
<img src=https://www.laguardia.edu/uploadedImages/Main_Site/Content/Admissions/Images/location_2.png alt=logo>
<h3>Lorem ipsum</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing</p>
</div>
<div class=item>
<img src=https://www.laguardia.edu/uploadedImages/Main_Site/Content/Admissions/Images/location_2.png alt=logo>
<h3>Lorem ipsum</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicin</p>
</div>
<div class=item>
<img src=https://www.laguardia.edu/uploadedImages/Main_Site/Content/Admissions/Images/location_2.png alt=logo>
<h3>Lorem ipsum</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing</p>
</div>
</div>
</section>
<section id=ready>
<div class=container>
<h2>Ready to get started?</h2>
<a type="submit">Sign up!</a>
</div>
</section>
<section id=prefooter>
<ul>
<li class=main><a href=#>Product</a></li>
<li><a href=#>Business</a></li>
<li><a href=#>Compare</a></li>
<li><a href=#>Features</a></li>
<li><a href=#>Pricing</a></li>
</ul>
<ul>
<li class=main><a href=#>We're</a></li>
<li><a href=#>Blog</a></li>
<li><a href=#>News</a></li>
<li><a href=#>Press releases</a></li>
<li><a href=#>Jobs</a></li>
</ul>
<ul>
<li class=main><a href=#>More</a></li>
<li><a href=#>Support</a></li>
<li><a href=#>Developers</a></li>
<li><a href=#>Customer services</a></li>
<li><a href=#>Get Start Guide</a></li>
</ul>
<form action="/action_page.php">
<p>Subscribe</p>
<input type="email" name="email" placeholder="E-mail">
<input type="submit" value=♠>
</form>
</section>
<footer>
<p>© 2018 All rights reserved.</p>
<p class=by>Designed by Karolis</p>
</footer>
* {
margin: 0;
padding: 0;
font-family: "Open Sans", sans-serif;
letter-spacing: 0.0725em;
box-sizing: border-box;
}
@viewport {
width: device-width;
}
.container {
width: 80%;
margin: auto;
}
/** Showcase **/
#showcase {
background: url(https://images.unsplash.com/photo-1523882885805-8155d776209a?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=9008fa49868f5acaad43a9d7c9de158d&auto=format&fit=crop&w=1051&q=80);
background-size: cover;
background-position: 60%;
background-repeat: no-repeat;
height: 90vh;
}
#showcase .navbar {
display: flex;
justify-content: space-between;
align-items: center;
justify-items: stretch;
padding: 10px 90px;
transition: all 1s;
position: fixed;
top: 0;
width: 100%;
z-index: 999;
}
#showcase .logo span {
color: #e0c233;
font-weight: 900;
}
#showcase .logo a {
color: #fff;
text-decoration: none;
text-transform: uppercase;
letter-spacing: 4px;
font-size: 24px;
}
#showcase nav ul li {
display: inline;
}
#showcase nav ul li a {
margin-left: 60px;
color: #fff;
text-decoration: none;
font-size: 14px;
}
#showcase nav ul li a:hover {
border-bottom: 3px #e0c233 solid;
transition: all 0.7s;
}
#showcase .link {
background-color: #e0c233;
border-radius: 16px;
color: white;
padding: 10px 34px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
transition-timing-function: linear;
transition: all 1s;
}
#showcase .link:hover {
background-color: transparent;
color: #e0c233;
padding: 10px 34px;
transition-timing-function: linear;
transition: all 1s;
transform: scale(1.4);
}
#showcase .title h1 {
line-height: 1.2em;
font-size: 60px;
color: #fff;
text-transform: uppercase;
font-weight: 400;
padding-top: 200px;
}
#showcase .under {
border-bottom: 20px #e0c233 solid;
}
#showcase .getstarted {
margin-top: 25px;
background-color: transperant;
border: 1px #fff solid;
border-radius: 16px;
color: white;
padding: 10px 22px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
transition: all 1s;
}
#showcase .getstarted:hover {
color: #e0c233;
transition: all 1s;
transform: scale(1.4);
border: none;
}
/** KEEP **/
#keep {
background-image: linear-gradient(
to right,
rgba(224, 194, 51, 0.4),
rgba(224, 194, 61, 0.9)
),
url(https://images.unsplash.com/photo-1517134191118-9d595e4c8c2b?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=f64af19374484d1e18a6e79a439cff9d&auto=format&fit=crop&w=750&q=80);
height: 480px;
width: 850px;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
border-radius: 6px;
box-shadow: 0px 8px 35px 0px rgba(0, 0, 0, 0.6);
margin-top: 80px;
display: flex;
flex-direction: column;
align-items: center;
position: absolute;
top: -380px;
}
#keep h2 {
color: #fff;
width: 90%;
margin: auto;
text-align: center;
text-transform: uppercase;
line-height: 1.6em;
font-size: 44px;
letter-spacing: 0.15em;
}
.tevuks {
position: relative;
}
/** YOURS **/
#yours {
background-color: #f9f3d9;
height: 720px;
margin-top: 400px;
padding-top: 300px;
}
#yours h2 {
font-size: 46px;
text-transform: uppercase;
}
#yours .gridas {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 90%;
margin: auto;
}
#yours .item {
margin-top: 80px;
width: 200px;
text-align: center;
}
#yours i {
color: #e0c233;
}
#yours .item h3 {
color: #33658a;
text-transform: uppercase;
font-size: 15px;
margin-top: 15px;
}
#yours .item p {
margin-top: 20px;
font-size: 14px;
}
/** How **/
#how {
margin: 200px 0;
background-image: url(https://images.unsplash.com/photo-1471897488648-5eae4ac6686b?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=1b2594335160b81127cf3e122f73b72a&auto=format&fit=crop&w=634&q=80);
background-repeat: no-repeat;
background-position: 80%;
}
#how h2 {
font-size: 46px;
text-transform: uppercase;
}
#how .gridasc {
display: flex;
flex-direction: column;
}
#how .item {
width: 250px;
margin-top: 90px;
display: grid;
grid-template-columns: auto auto;
grid-template-rows: 1fr 1fr;
grid-gap: 10px;
}
#how img {
height: 40px;
width: auto;
grid-row: 1/3;
}
#how .item h3 {
color: #33658a;
text-transform: uppercase;
font-size: 15px;
}
#how .item p {
font-size: 14px;
}
/** Ready? **/
#ready {
background: linear-gradient(
360deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0.1)
),
url(https://images.unsplash.com/photo-1493589862228-e15fe8a39596?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=9f332d0919321d1654296b747dc1e0dc&auto=format&fit=crop&w=1834&q=80);
background-attachment: fixed;
background-position: 19% 50%;
height: 350px;
background-size: 120%;
text-align: center;
display: flex;
}
#ready h2 {
text-transform: uppercase;
color: #e0c233;
font-size: 36px;
border-radius: 12px;
padding-bottom: 20px;
}
#ready a {
background-color: #fff;
border: 1px #e0c233 solid;
border-radius: 16px;
color: #e0c233;
padding: 10px 22px;
text-align: center;
text-decoration: none;
font-size: 16px;
cursor: pointer;
transition: all 1s;
}
#ready a:hover {
transition: all 2s;
transform: scale(1.4) rotate(1080deg);
}
#prefooter {
background-color: #e0c233;
height: 250px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-end;
margin: auto;
padding: 0 40px;
}
#prefooter ul {
padding-bottom: 40px;
}
#prefooter ul li {
list-style-type: none;
font-size: 14px;
padding-bottom: 10px;
}
#prefooter ul li a {
text-decoration: none;
color: #fff;
}
#prefooter .main {
font-weight: 900;
padding-bottom: 20px;
font-size: 17px;
}
#prefooter p {
color: #fff;
font-size: 17px;
}
#prefooter form {
align-self: center;
padding-bottom: 35px;
text-align: center;
}
#prefooter input[type=email] {
margin-top: 15px;
border: none;
padding: 6px 12px;
border-radius: 12px;
}
#prefooter input[type=submit] {
font-size: 20px;
}
footer {
padding: 15px 0;
width: 90%;
margin: auto;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
}
/*** Media Queries ***/
@media only screen and (max-width: 768px) {
.container {
width: 95%;
text-align: center;
}
#showcase .link {
display: none;
}
#showcase .navbar {
display: flex;
flex-direction: row;
justify-content: center;
padding: 0;
text-align: center;
}
#showcase {
height: 650px;
}
#showcase .logo {
padding: 0 10px;
}
#showcase .navbar ul li a {
margin: 0 10px;
}
#showcase .title h1 {
}
#keep {
width: 90%;
}
#keep h2 {
line-height: 1.7;
font-size: 32px;
}
#yours {
min-height: 1050px;
}
#yours h2 {
margin-bottom: 30px;
}
#yours .gridas {
display: flex;
flex-direction: column;
}
#yours .item {
margin: auto;
padding-top: 20px;
}
#how {
margin-top: 0px;
background-size: 80%;
background-position: center;
display: flex;
flex-direction: column;
}
#how .image {
display: inline;
}
#how h2 {
padding: 50px 0;
}
#how .gridasc {
display: flex;
flex-direction: column;
justify-content: center;
}
#how .item img {
width: 90px;
height: auto;
margin: auto;
padding-bottom: 10px;
}
#how .item {
margin: 50px auto;
display: flex;
flex-direction: column;
justify-content: center;
}
#ready {
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
padding: 50px 0;
}
#ready h2 {
padding: 35px;
min-width: 200px;
margin-bottom: 40px;
}
#ready a {
margin-top: 50px;
}
#prefooter {
display: flex;
flex-direction: column;
height: auto;
justify-content: center;
padding-top: 40px;
}
#prefooter ul {
margin: auto;
width: 80px;
}
}
$(document).ready(function () {
var scroll_start = 0;
var startchange = $(".title");
var offset = startchange.offset();
if (startchange.length) {
$(document).scroll(function () {
scroll_start = $(this).scrollTop();
if (scroll_start > offset.top) {
$(".navbar").css('background-color', 'rgba(255,255,255,.9)');
$(".menu").css('color', 'rgb(0,0,0)');
$(".logo a").css('color', 'rgb(0,0,0)');
} else {
$('nav').css('background-color', 'transparent');
$(".menu").css('color', 'rgb(255,255,255)');
$(".logo a").css('color', 'rgb(255,255,255)');
}
});
}
});
Also see: Tab Triggers