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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
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.
If the stylesheet 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 CSS 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.
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.
Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.
Upgrade to PROIf 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.
Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.
Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:
Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.
This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.
Upgrade to PRO
<nav>
<h3><a href="#">Start Bootstrap</a></h3>
<ul>
<li><a href="#">Services</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<!-- Masthead -->
<header class="masthead d-flex">
<div class="container text-center my-auto">
<h1 class="mb-1 type-it bounceInDown animated"></h1>
<p class="lead maintxt bounceInDown animated">I am a Front End developer based in the UK. If you are a business seeking a web presence or an employer looking to hire, you can get in touch with me <a href="#contact" class="txtlink2 js-scroll-trigger" target="_blank">here</a>.</p>
<hr class="home bounceInDown animated">
<a class="btn btn-primary btn-xl rounded js-scroll-trigger bounceInDown animated" href="#features-icons">Find Out More <i class="fa fa-chevron-down" aria-hidden="true"></i></a>
</div>
</header>
<!-- Icons Grid -->
<section class="features-icons bg-light text-center" id="features-icons">
<div class="container">
<h2 class="mb-5">What You Can Expect</h2>
<hr class="black">
<div class="row">
<div class="col-lg-4">
<div class="features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3">
<div class="features-icons-icon d-flex">
<i class="fas fa-desktop m-auto text-primary"></i>
</div>
<h3>Fully Responsive</h3>
<p class="lead mb-0">This theme will look great on any device, no matter the size!</p>
</div>
</div>
<div class="col-lg-4">
<div class="features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3">
<div class="features-icons-icon d-flex">
<i class="fas fa-desktop m-auto text-primary"></i>
</div>
<h3>Bootstrap 4 Ready</h3>
<p class="lead mb-0">Featuring the latest build of the new Bootstrap 4 framework!</p>
</div>
</div>
<div class="col-lg-4">
<div class="features-icons-item mx-auto mb-0 mb-lg-3">
<div class="features-icons-icon d-flex">
<i class="fas fa-desktop m-auto text-primary"></i>
</div>
<h3>Easy to Use</h3>
<p class="lead mb-0">Ready to use with your own content, or customize the source files!</p>
</div>
</div>
</div>
</div>
</section>
<!-- Testimonials -->
<section class="testimonials text-center bg-light">
<div class="container">
<h2 class="mb-5">What people are saying...</h2>
<hr class="black">
<div class="row">
<div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="images/testimonials-1.jpg" alt="">
<h5>Margaret E.</h5>
<p class="font-weight-light mb-0">"This is fantastic! Thanks so much guys!"</p>
</div>
</div>
<div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="images/testimonials-2.jpg" alt="">
<h5>Fred S.</h5>
<p class="font-weight-light mb-0">"Bootstrap is amazing. I've been using it to create lots of super nice landing pages."</p>
</div>
</div>
<div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="images/testimonials-3.jpg" alt="">
<h5>Sarah W.</h5>
<p class="font-weight-light mb-0">"Thanks so much for making these free resources available to us!"</p>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright © Your Website 2018</p>
</div>
<!-- /.container -->
</footer>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
@import url('https://fonts.googleapis.com/css?family=Kaushan+Script|Montserrat');
html {
height: 1200px;
font-size: 16px;
}
body {
height: 100%;
background: url("https://blackrockdigital.github.io/startbootstrap-agency/img/header-bg.jpg") no-repeat center top / cover;
}
body * {
/* border: 1px solid; */
}
nav {
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: space-around;
align-items: center;
padding: 1rem 0;
width: 100%;
transition: background-color 100ms linear;
}
nav * {
margin: 0;
padding: 0;
}
nav h3 {
flex: 1;
text-align: center;
}
nav h3 a {
display: inline-block;
/* margin-left: 0.33rem; */
color: #fed136;
font-family: 'Kaushan Script', Helvetica, Arial, cursive;
font-size: 1.75rem;
text-decoration: none;
transition: font-size 200ms linear;
}
nav ul {
flex: 1;
display: flex;
justify-content: center;
}
nav ul li {
display: inline-block;
margin: 0.5rem;
}
nav ul li:last-child {
margin-right: 4rem;
}
nav ul li a {
color: white;
font-family: Montserrat, Helvetica, Arial, sans-serif;
font-size: 0.9rem;
text-decoration: none;
text-transform: uppercase;
}
nav ul li a:hover {
color: #fed136;
}
.scrolled-nav {
background-color: #212529;
}
.scrolled-nav h3 a {
font-size: 1rem;
}
h1 {
font-weight: 700;
text-transform: uppercase;
}
h2,
{
font-weight: 700;
text-transform: uppercase;
margin-top: 0;
margin-bottom: .5rem
}
p {
margin-top: 0;
margin-bottom: 1rem
}
.masthead {
color: #fff;
min-height: 30rem;
width: 100%;
height: auto;
padding-top: 8rem;
padding-bottom: 8rem;
background: url(../images/header.jpg);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
.masthead h1 {
font-size: 3rem;
margin: 0;
padding: 0
}
@media (min-width:992px) {
.masthead {
height: 100vh
}
.masthead h1 {
font-size: 3.5rem
}
}
.features-icons {
padding-top: 7rem;
padding-bottom: 7rem;
}
.features-icons .features-icons-item {
max-width: 20rem
}
.features-icons .features-icons-item .features-icons-icon {
height: 7rem
}
.features-icons .features-icons-item .features-icons-icon i {
font-size: 4.5rem
}
.features-icons .features-icons-item:hover .features-icons-icon i {
font-size: 5rem
}
.testimonials {
padding-top: 7rem;
padding-bottom: 7rem
}
.testimonials .testimonial-item {
max-width: 18rem
}
.testimonials .testimonial-item img {
max-width: 12rem;
box-shadow: 0 5px 5px 0 #adb5bd
}
footer.footer {
padding-top: 4rem;
padding-bottom: 4rem
}
.mt-4,
.my-4 {
margin-top: 1.5rem !important
}
hr.black {
border-color: black;
max-width: 3.125rem;
border-width: 0.2rem;
}
hr.white {
border-color: white;
max-width: 3.125rem;
border-width: 0.2rem;
}
hr.home {
border-color: white;
max-width: 9rem;
border-width: 0.2rem;
}
.txtlink2 {
color: #fff;
font-weight: bold;
}
.txtlink2:hover {
color: #fff;
text-decoration: underline;
}
/*Extra small devices (portrait phones, less than 576px) // No media query since this is the default in Bootstrap
Small devices (landscape phones, 576px and up)*/
@media (min-width: 576px) {
.maintxt {
max-width: ;
}
}
/* Medium devices (tablets, 768px and up)*/
@media (min-width: 768px) {
.maintxt {
max-width: ;
}
}
/* Large devices (desktops, 992px and up)*/
@media (min-width: 992px) {
.maintxt {
max-width: ;
}
}
/* Extra large devices (large desktops, 1200px and up)*/
@media (min-width: 1200px) {
.maintxt {
max-width: ;
}
}
nav {
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: space-around;
align-items: center;
padding: 1rem 0;
width: 100%;
transition: background-color 100ms linear;
}
nav * {
margin: 0;
padding: 0;
}
nav h3 {
flex: 1;
text-align: center;
}
nav h3 a {
display: inline-block;
/* margin-left: 0.33rem; */
color: #fed136;
font-family: 'Kaushan Script', Helvetica, Arial, cursive;
font-size: 1.75rem;
text-decoration: none;
transition: font-size 200ms linear;
}
nav ul {
flex: 1;
display: flex;
justify-content: center;
}
nav ul li {
display: inline-block;
margin: 0.5rem;
}
nav ul li:last-child {
margin-right: 4rem;
}
nav ul li a {
color: white;
font-family: Montserrat, Helvetica, Arial, sans-serif;
font-size: 0.9rem;
text-decoration: none;
text-transform: uppercase;
}
nav ul li a:hover {
color: #fed136;
}
.scrolled-nav {
background-color: #212529;
}
.scrolled-nav h3 a {
font-size: 1rem;
}
jQuery(document).ready(function($) {
$('.type-it').typeIt({
content: 'Hi, my name is Liam Docherty'
});
});
const nav = document.querySelector('nav');
window.addEventListener('scroll', () => {
const scrollY = window.scrollY;
if (scrollY < 100) {
nav.classList.remove('scrolled-nav');
} else if (scrollY >= 100 && scrollY < 200) {
nav.classList.add('scrolled-nav');
}
});
Also see: Tab Triggers