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.
<html>
<head>
<title>Product Landing Page</title>
</head>
<body>
<header id="header">
<div class="logo">
<img id="header-img" src="https://www.dropbox.com/s/hzeqqpgan8onpnr/logo1.png?dl=0" alt="Drum Logo">
</div>
<nav id="nav-bar">
<ul>
<li><a class="nav-link" href="#interesting-facts">Interesting Facts</a></li>
<li><a class="nav-link" href="#how-it-works">How it Works</a></li>
<li><a class="nav-link" href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<section id="interesting-facts">
<div class="grid">
<div class="desc">
<h2>
Drums Make You Live Longer!
</h2>
<p>
The first of the drum facts on this list is the statement of 107-year old Viola Smith- who claims that her love and practise of drumming has seen her live a long and healthy life.
One of the world’s first professional female drummers, as of November 2019 she was still drumming professionally in the Forever Young Band: America’s Oldest Act of Professional Entertainers!
</p>
</div>
</div>
<div class="grid">
<div class="desc">
<h2>
Talking Drums
</h2>
<p>
African tribal drummers were so skilled at drumming that they could accurately mimic the patterns of speech through performing rhythms.
This was used to send messages long distances to other tribesmen who would otherwise be out of earshot. This skill was used by tribespeople as far apart as Ghana and Southern Africa!
</p>
</div>
</div>
<div class="grid">
<div class="desc">
<h2>
Don’t Let Anything Hold You Back
</h2>
<p>
You can play difficult drum parts with only one arm! Rick Allen of Def Leppard fame joined up with the band when he was just fourteen – his mum wrote in reply to the ad looking for a drummer on his behalf! –
but lost his arm while they were still on their way to legendary status. After recovering, he rearranged his gear to use extra foot pedals to replace the drum set components he used to operate with his left arm.
</p>
</div>
</div>
<div class="grid">
<div class="desc">
<h2>
The Oldest Instrument
</h2>
<p>
Drums have not changed much over the millennia. The form of a drum has stayed virtually the same:
a skin or membrane stretched tightly over a hollow contained space that provides the reverberation needed to make the sound.
</p>
</div>
</div>
<div class="grid">
<div class="desc">
<h2>
Drummers from All Over
</h2>
<p>
Another record was broken in 2019 when the Australian city of Stirling was determined to strike a blow for harmony and diversity.
They succeeded in bringing together over 100 drummers of 77 different nationalities to play together for long enough to satisfy the Guinness Records judge. They succeeded and hold the title of ‘most nationalities in a drum circle‘.
</p>
</div>
</div>
</section>
<section id="how-it-works">
<iframe
id="video"
width="560"
height="315"
src="https://www.youtube-nocookie.com/embed/YEq7GZFyh6M"
title="YouTube video player"
frameborder="0"
allowfullscreen>
</iframe>
</section>
<section id="hero">
<h2>Stage Star, Fine Tunes</h2>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id="email" name="email" type="email" placeholder="Enter Your Email Here" required>
<input id="submit" type="submit" value="Get Started" class="btn">
</form>
</section>
<footer id="contact">
<ul>
<li><a href="#">Facebook</a></li>
<li><a href="#">Twitter</a></li>
<li><a href="#">Instagram</a></li>
</ul>
</footer>
</body>
</html>
body {
background-color: #eee;
font-family: 'Lato', sans-serif;
margin: 0;
padding: 0;
}
header {
position: fixed;
width: 100%;
top: 0;
display: flex;
justify-content: space-round;
align-items: center;
color: white;
font-family: 'Exo 2', sans-serif;
}
nav {
width: 100%;
background: white;
overflow: auto;
}
nav a {
width: 100%;
display: block;
padding: 20px 15px;
text-decoration: none;
text-align: center;
}
nav a:hover {
background: #eee;
transition: 0.5s;
text-transform: uppercase;
}
a {
text-decoration: none:
}
ul {
padding: 0;
margin: 0 0 0 150px;
list-style: none;
}
li {
float: left;
padding-right: 150px;
margin-left: 20px;
}
.logo {
position: absolute;
margin-top: 15px;
margin-left: 10px;
width: 150px;
}
#header-image {
position: relative;
display: inline;
height: 2rem;
width: 150px;
max-width: 300px;
margin-left: 50px;
}
@media (max-width: 600px) {
header {
flex-wrap: wrap;
}
}
.grid {
display: flex;
}
#interesting-facts {
margin-top: 50px;
}
#interesting-facts .desc {
display: flex-wrap;
flex-direction: column;
justify-content: center;
height: 120px;
width: 80vw;
padding: 2px;
margin-left: 30px;
}
#how-it-works {
margin-top: 50px;
display: flex;
justify-content: center;
}
#how-it-works > iframe {
max-width: 560px;
width: 100%;
}
#hero {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
height: 200px;
margin-top: 50px;
}
#hero > h2 {
margin-bottom: 20px;
word-wrap: break-word;
}
#hero input[type='email'] {
max-width: 275px;
width: 100%;
padding: 5px;
}
#hero input[type='submit'] {
max-width: 150px;
width: 100%;
height: 30px;
margin: 15px 0;
border: 0;
background-color: #f1c40f;
}
#hero input[type='submit']:hover {
background-color: orange;
transition: background-color 1s;
}
@media (max-width: 650px) {
#hero {
margin-top: 120px;
}
}
footer {
margin-top: 30px;
background-color: #ddd;
padding: 20px;
}
footer > ul {
display: flex;
justify-content: flex-end;
}
footer > ul > li {
padding: 0 10px;
}
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
Also see: Tab Triggers