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.
<header class="fixed-top page-header">
<div class="container-fluid container-fluid-max">
<nav id="navbar" class="navbar navbar-expand-lg navbar-dark">
<a class="navbar-brand" href="#home">HoneyDreams</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-lg-between" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#process">How It Works</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#featured-destinations">Featured Destinations</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#popular-destinations">Popular Destinations</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#request-quote">Request a Quote</a>
</li>
</ul>
<div class="text-white">
<a href="tel:1234567890" class="mr-2">
<i class="fas fa-phone"></i>
<div class="d-none d-xl-inline">1234567890</div>
</a>
<a href="mailto:info@honeydreams.com">
<i class="fas fa-envelope"></i>
<div class="d-none d-xl-inline">info@honeydreams.com</div>
</a>
</div>
</div>
</nav>
</div>
</header>
<main>
<section id="home" class="d-flex align-items-center position-relative vh-100 cover hero" style="background-image:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/cappadocia.jpg);">
<div class="container-fluid container-fluid-max">
<div class="row">
<div class="col-12 col-md-8 col-lg-6 col-xl-5">
<h1 class="text-white">Live an unforgettable experience in Cappadocia!</h1>
<div class="mt-3">
<a class="btn bg-red text-white mr-2" href="" role="button">Book Now</a>
<a class="btn bg-red text-white" href="" role="button">Select Your Package</a>
</div>
</div>
</div>
</div>
</section>
<section id="process" class="process">
<div class="container-fluid container-fluid-max">
<div class="row text-center py-5">
<div class="col-12 pb-4">
<h2 class="text-red">How It Works</h2>
</div>
<div class="col-12 col-sm-6 col-lg-3">
<span class="fa-stack fa-2x">
<i class="fas fa-circle fa-stack-2x text-red"></i>
<i class="fas fa-map-marked fa-stack-1x text-white"></i>
</span>
<h3 class="mt-3 text-red h4">Choose a destination</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit sed repudiandae.</p>
</div>
<div class="col-12 col-sm-6 col-lg-3">
<span class="fa-stack fa-2x">
<i class="fas fa-circle fa-stack-2x text-red"></i>
<i class="fas fa-plane fa-stack-1x text-white"></i>
</span>
<h3 class="mt-3 text-red h4">Book a flight</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit sed repudiandae.</p>
</div>
<div class="col-12 col-sm-6 col-lg-3">
<span class="fa-stack fa-2x">
<i class="fas fa-circle fa-stack-2x text-red"></i>
<i class="fas fa-car fa-stack-1x text-white"></i>
</span>
<h3 class="mt-3 text-red h4">Rent a car</h3>
<p>Nor again is there anyone who loves or pursues or desires to obtain pain.</p>
</div>
<div class="col-12 col-sm-6 col-lg-3">
<span class="fa-stack fa-2x">
<i class="fas fa-circle fa-stack-2x text-red"></i>
<i class="fas fa-home fa-stack-1x text-white"></i>
</span>
<h3 class="mt-3 text-red h4">Rent an appartment</h3>
<p>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi.</p>
</div>
<div class="col-12 pt-3">
<a class="btn bg-red text-white" target="_blank" href="https://en.wikipedia.org/wiki/Neuschwanstein_Castle" role="button">Learn More →</a>
</div>
</div>
</div>
</section>
<section id="featured-destinations" class="featured-destinations bg-lightblue">
<div class="row no-gutters">
<div class="col-12 col-md-6 d-flex align-items-center order-1 order-md-0">
<div class="p-15">
<h3>Explore Norway</h3>
<p><strong>Ålesund</strong> is a town and municipality in Møre og Romsdal County, Norway. It is part of the traditional district of Sunnmøre and the centre of the Ålesund Region. It is a sea port and is noted for its concentration of Art Nouveau
architecture. The town of Ålesund is the administrative centre of Ålesund Municipality, as well as the principal shipping town of the Sunnmøre district. </p>
<p>The 99-square-kilometre (38 sq mi) municipality is the 382nd largest by area out of the 422 municipalities in Norway. Ålesund is the 17th most populous municipality in Norway with a population of 47,199. The municipality's population density
is 506.6 inhabitants per square kilometre (1,312/sq mi) and its population has increased by 14% over the last decade.</p>
<a class="btn bg-red text-white" target="_blank" href="https://en.wikipedia.org/wiki/%C3%85lesund" role="button">Read More →</a>
</div>
</div>
<div class="col-12 col-md-6 order-0 order-md-1">
<div class="vh-100 cover" style="background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/norway_700.jpg);"></div>
</div>
<div class="col-12 col-md-6 order-2">
<div class="vh-100 cover" style="background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/germany_700.jpg);"></div>
</div>
<div class="col-12 col-md-6 d-flex align-items-center order-3">
<div class="p-15">
<h3>Explore Germany</h3>
<p><strong>Neuschwanstein Castle</strong> is a 19th-century Romanesque Revival palace on a rugged hill above the village of Hohenschwangau near Füssen in southwest Bavaria, Germany. The palace was commissioned by Ludwig II of Bavaria as a retreat
and in honour of Richard Wagner. Ludwig paid for the palace out of his personal fortune and by means of extensive borrowing, rather than Bavarian public funds.</p>
<p>The castle was intended as a home for the king, until he died in 1886. It was open to the public shortly after his death. Since then more than 61 million people have visited Neuschwanstein Castle. More than 1.3 million people visit annually,
with as many as 6,000 per day in the summer.</p>
<a class="btn bg-red text-white" target="_blank" href="https://en.wikipedia.org/wiki/Neuschwanstein_Castle" role="button">Read More →</a>
</div>
</div>
</div>
</section>
<section id="popular-destinations" class="popular-destinations py-5">
<div class="container-fluid container-fluid-max">
<div class="row">
<div class="col-12">
<h2 class="pb-3 text-red">Popular Destinations</h2>
</div>
<div class="col-12 col-sm-6 col-md-4">
<a href="" class="text-white">
<figure class="position-relative overflow-hidden">
<img class="img-fluid" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/Vienna.jpg" alt="Vienna">
<figcaption class="d-flex align-items-center justify-content-center position-absolute">
<h3>Vienna</h3>
</figcaption>
</figure>
</a>
</div>
<div class="col-12 col-sm-6 col-md-4">
<a href="" class="text-white">
<figure class="position-relative overflow-hidden">
<img class="img-fluid" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/Edinburgh.jpg" alt="Edinburgh">
<figcaption class="d-flex align-items-center justify-content-center position-absolute">
<h3>Edinburgh</h3>
</figcaption>
</figure>
</a>
</div>
<div class="col-12 col-sm-6 col-md-4">
<a href="" class="text-white">
<figure class="position-relative overflow-hidden">
<img class="img-fluid" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/new_york.jpg" alt="New York">
<figcaption class="d-flex align-items-center justify-content-center position-absolute">
<h3>New York</h3>
</figcaption>
</figure>
</a>
</div>
<div class="col-12 col-sm-6">
<a href="" class="text-white">
<figure class="position-relative overflow-hidden">
<img class="img-fluid" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/porto.jpg" alt="Porto">
<figcaption class="d-flex align-items-center justify-content-center position-absolute">
<h3>Porto</h3>
</figcaption>
</figure>
</a>
</div>
<div class="col-12 col-md-6">
<a href="" class="text-white">
<figure class="position-relative overflow-hidden">
<img class="img-fluid" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/162656/manarola.jpg" alt="Manarola">
<figcaption class="d-flex align-items-center justify-content-center position-absolute">
<h3>Manarola</h3>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="row">
<div class="col text-center">
<a class="btn bg-red text-white" href="" role="button">More Destinations ↓</a>
</div>
</div>
</div>
</section>
<section id="request-quote" class="py-5 request-quote bg-lightblue">
<div class="container-fluid container-fluid-max">
<div class="row justify-content-center">
<div class="col-12 col-md-auto py-3 text-center">
<h2 class="mb-0 text-red">Ready to start your next journey?</h2>
<p class="mb-0 h4 text-red font-weight-normal">Get in touch today!</p>
</div>
<div class="col-12 col-md-auto d-flex justify-content-center align-items-center">
<a class="btn bg-red text-white font-weight-bold" href="" role="button">
REQUEST A QUOTE
<i class="ml-1 fas fa-hand-point-right"></i>
</a>
</div>
</div>
</div>
</section>
</main>
<footer class="py-5 page-footer">
<div class="container-fluid container-fluid-max">
<div class="row">
<div class="col-12 col-md-6 footer-child copyright">
HoneyDreams © 2018 All Rights Reserved
</div>
<div class="col-12 col-md-6 footer-child footer-links">
<a href="" class="mr-3">Privacy Policy</a>
<a href="">FAQ</a>
<div>
<small>Made with <i class="fas fa-heart text-red"></i> by <a href="http://georgemartsoukos.com/" target="_blank">George Martsoukos</a>
</small>
</div>
</div>
</div>
</div>
</footer>
/* RESET RULES & HELPER CLASSES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
:root {
--lightblue: #f6f9fc;
--red: #d64041;
}
a,
a:hover {
color: inherit;
}
a:hover {
text-decoration: none;
}
.bg-lightblue {
background: var(--lightblue);
}
.bg-red {
background: var(--red);
}
.text-red {
color: var(--red);
}
.container-fluid-max {
max-width: 1440px;
}
.cover {
background: no-repeat center/cover;
}
.p-15 {
padding: 15px;
}
/* SCROLL ANIMATIONS
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.scroll .page-header {
background: var(--red);
}
.scroll .hero {
transform: scale(0.98);
}
/* HEADER
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.page-header {
transition: background 0.5s ease-in-out;
}
.page-header .navbar {
padding: 1rem 0;
}
.page-header .navbar-toggler {
/* the variable is inherited from BS4 built-in variables */
border-color: var(--white);
}
/* BANNER SECTION
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.hero {
background-attachment: fixed;
transition: transform 0.5s ease-in-out;
}
.hero::after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: linear-gradient(
rgba(0, 0, 0, 0.5) 0,
rgba(0, 0, 0, 0.3) 50%,
rgba(0, 0, 0, 0.1) 100%
);
}
.hero .container-fluid {
z-index: 10;
}
/* POPULAR DESTINATIONS SECTION
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.popular-destinations figure {
margin-bottom: 30px;
}
.popular-destinations figcaption {
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, 0.3);
}
.popular-destinations img {
filter: grayscale(100%) blur(3px);
transition: transform 0.5s, filter 0.75s;
}
.popular-destinations a:hover img {
transform: scale(1.25);
filter: none;
}
/* PAGE FOOTER
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.page-footer .footer-links {
text-align: right;
}
/* MEDIA QUERIES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
/* MEDIUM SCREENS */
@media screen and (max-width: 991px) {
.page-header {
background: var(--red);
}
}
/* SMALL SCREENS */
@media screen and (max-width: 767px) {
.page-footer .footer-child {
text-align: center;
}
}
Also see: Tab Triggers