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.
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<header id="header">
<div class="header-container">
<div class="logo-container">
<img src="https://ih0.redbubble.net/cover.806603.2400x600.jpg" alt="ten hundred logo" id="header-img">
</div>
<nav id="nav-bar">
<a class="nav-link" href="#about">About Ten Hundred</a>
<a class="nav-link" href="#pricing">Subscription Options</a>
<a class="nav-link" href="#contact">Contact Us</a>
<a class="nav-link" href="#newsletter">Newsletter</a>
</nav>
</div>
</header>
<section id="about">
<h1>About Ten Hundred</h1>
<img src="https://1.bp.blogspot.com/-qtIk_3_KUHs/UyKO1OJl7aI/AAAAAAAABfs/4-2c2dB0sgk/w1200-h630-p-k-no-nu/Ten+Hun.jpg" alt="peter robinson ten hundred">
<p>Ten Hundred (Peter Robinson) is an artist and designer from Seattle, WA. He was born in Michigan and settled in Seattle in 2006. He specializes in bright, colorful, imaginative character work. He is inspired by cartoons, anime, street art, graffiti, childlike imagination, comics, world cutltures, religions and folklore. He spends his time creating art, curating gallery shows, designing art for businesses and making merchandise. Recently he has completed work for Nordstrom, Converse, Jet Blue, Caffe Vita, Sasquatch Music Festival and more. Ten Hundred is creating his own alternate reality one piece of art at a time.</p>
</section>
<section id="pricing">
<h2>Subscription Options</h2>
<iframe width="560" height="315" name"video" id="video" src="https://www.youtube.com/embed/uzb1nnztIkI" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</video>
<container class="product" id="product1">
<div class="title">One Print Per Month</div>
<div class="money">$18</div>
<p class="description">You will receive one signed print each month!
</p>
<input id="select" type="button" name="select" value="Select" />
</container>
<container class="product" id="product2">
<div class="title">Two Prints Per Month</div>
<div class="money">$32</div>
<p class="description">You will receive two signed prints each month!
</p>
<input id="select" type="button" name="select" value="Select" />
</container>
<container class="product" id="product3">
<div class="title">Three Prints Per Month</div>
<div class="money">$45</div>
<p class="description">You will receive three signed prints each month!
</p>
<input id="select" type="button" name="select" value="Select" />
</container>
</section>
<section id="contact">
<h1>Contact Us</h1>
<p>Please use the form below for any questions you may have or if you are wanting to inquire about commissioning a piece of art: </p>
<div class="container">
<form>
<label for="fname">First Name</label>
<input type="text" id="fname" name="firstname" placeholder="First Name:">
<label for="lname">Last Name</label>
<input type="text" id="lname" name="lastname" placeholder="Last Name:">
<label for="subject">Subject</label>
<textarea id="subject" name="subject" placeholder="Write Something..." style="height:200px"></textarea>
<input type="submit" value="Submit" value="Submit" class="btn" />
</form>
</div>
<section id="newsletter">
<span>If you would like to subscribe to Ten Hundred's newsletter, please submit your email address below:</span>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input name="email" id="email" type="email" placeholder="Enter Email Address" required />
<input id="submit" type="submit" value="Subscribe" class="btn" />
</form>
</section>
html {
scroll-behavior: smooth;
}
body {
background-color: #fff;
font-family: Tahoma, Geneva, sans-serif;
}
.header-container {
position: sticky;
top: 0;
display: flex;
min-height: 100px;
min-width: 200px;
width: 100%;
flex-flow: row wrap;
justify-content: space-between;
align-items: center;
background: #000;
z-index: 5;
}
@media (max-width: 600px) {
.header-container {
flex-flow: column wrap;
justify-content: space-evenly;
align-items: center;
}
}
#header-img {
height: 200px;
z-index: 1;
float: left;
width: 100%;
}
#nav-bar {
width: auto;
float: none;
display: inline-block;
margin: 0 auto;
height: 75px;
display: flex;
flex-flow: row wrap;
justify-content: center;
align-items: center;
}
@media (max-width: 600px) {
#nav-bar {
min-height: 200px;
}
}
nav a {
min-width: 65px;
font-family: 'Montserrat', sans-serif;
font-weight: 700;
font-size: 20px;
text-decoration: none;
box-shadow: 7px -0px 9px -9px black;
padding: 1rem 1.6rem;
transition: color .4s;
transition: box-shadow .4s;
text-align: center;
}
nav a:link {
color: #fff;
justify-content: center;
}
.nav-link {
display: flex;
justify-content: center;
padding: 15px;
border: 4px solid #34ebe1;
margin: 0px 5px 0px 5px;
font-size: 1rem;
color: #fff;
text-decoration: none;
border-radius: 5px;
}
h1 {
color: #000;
font-size: 45px;
text-align: left;
display: inline-block;
position: relative;
width: 100%;
text-shadow: 5px 5px #34ebe1;
}
#about {
margin-top: 50px;
font-family: Arial, Helvetica, sans-serif;
}
@media only screen and (max-width: 600px) {
#about {
display: 100%;
text-align: center;
margin-top: 50px;
font-family: Arial, Helvetica, sans-serif;
}
}
img {
float: left;
margin: 0 40px 0 0;
}
p {
text-align: left;
font-size: 30px;
}
h2 {
color: #000;
font-size: 45px;
text-align: center;
display: inline-block;
position: relative;
width: 100%;
text-shadow: 5px 5px #34ebe1;
}
iframe {
display: block;
margin: auto;
}
.product {
display: inline-block;
flex-direction: column;
margin: 25px;
margin-left: 150px;
max-width: 400px;
border: 5px solid #000;
border-radius: 15px;
text-align: center;
padding: 0 0 10px 0;
}
.title {
background: #e84b13;
font-size: 2rem;
border-radius: 10px;
padding: 10px;
}
.money {
font-size: 2rem;
margin-top: 2rem;
}
#select {
background-color: #000;
padding: 1rem;
border-radius: 5px;
font-size: 2rem;
color: #fff;
border: 4px solid #e84b13;
cursor: pointer;
}
#newsletter {
text-align: center;
margin-top: 60px;
}
#span {
text-align: center;
margin-bottom: 100px;
}
.btn {
padding: 0 20px;
margin-top: 15px;
height: 30px;
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
background: #f79f07;
cursor: pointer;
}
input[type="text"],
select,
textarea {
width: 100%;
padding: 12px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
.container {
flex-direction: row;
border-radius: 5px;
background-color: #e08dc3;
padding: 20px;
}
Also see: Tab Triggers