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.
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>
<!--
Hello Camper!
For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding!
- The freeCodeCamp Team
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fender Landing page</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header id="header">
<div id="header-content">
<img src="https://i.imgur.com/4PUxA1Y.png" alt="Fender logo" id="header-img">
<nav id="nav-bar">
<ul>
<li><a class="nav-link" href="#description">Details</a></li>
<li><a class="nav-link" href="#specs">Specifications</a></li>
<li><a class="nav-link" href="#contacts">Contacts</a></li>
</ul>
</nav>
</div>
</header>
<div class="wrapper">
<main>
<video id="video" controls>
<source src="imgs/guitarVideo.mp4">
</video>
<div id="main-content">
<h3 id="mainText">Great guitar, great price</h3>
<p id="price">£300</p>
<h4>Key features</h4>
<p id="features">
-Single Coil Strat Pickups Create Strong, Clear Tones<br>
-Alder Body Provide a Warm, Sparkling High End<br>
-Maple Neck Creates Bright Characteristics<br>
-Vintage-Style Tremolo Bridge Offers Classic Pitch Bends<br>
-Die-Cast Tuners Provide Excellent Tuning Stability
</p>
</div>
<div class="guitarPics">
<img src="https://i.imgur.com/2q4JBqR.jpg" alt="Guitar front">
<img src="https://i.imgur.com/v7L7JPf.jpg" alt="Guitar back">
</div>
<div class="btn">
<p>ORDER YOURS!</p>
</div>
</main>
<div id="description">
<hr>
<h3 class="title">Full description</h3>
<h5 class="subtitle">Excellent Tonewoods</h5>
<p>The affinity series Stratocaster is crafted from a solid alder body with a maple neck and laurel fingerboard, delivering powerfully bright, clear tones with beefy mids and thick lows. While the alder tonewood provides strong, full-bodied sounds, the maple and laurel combination opens up the guitar’s midrange and gives the highs plenty of warmth and sparkle.</p>
<h5 class="subtitle">Beautifully designed</h5>
<p>Featuring a set of single-coil strat pickups, the squire produces a strong, clear tones that you would find on a Fender Stratocaster. Its 6-saddle tremolo bridge and die-cast tuners ensure the guitar stays in-tune, while providing the ability to create classic pitch bends. Volume and tone controls provide control over the guitars pickups, while the 5 way selector offers a range of powerful tones, creating a very versatile guitar.</p>
<h5 class="subtitle">Affinity series</h5>
<p>The Affinity Series Stratocaster has a proud heritage and has always been very popular due to its well known format. The contoured solid alder body is the same world-renowned style that fuelled the fires of Hendrix, Clapton, SRV, and thousands more. The Squier Affinity offers supreme playability as well as a great tone. The simplicity of this guitar allows it to be versatile with all types of players and styles</p>
</div>
<div id="specs">
<hr>
<h3 class="title">Specifications</h3>
<p>
Model Number: 0310600596<br>
Series: Affinity
</p>
<h5 class="subtitle">Body & bridge</h5>
<p>
Body: Alder<br>
Shape: Stratocaster<br>
Bridge: 6-Saddle Vintage-Style Synchronised Tremolo<br>
Construction: Bolt-On<br>
Finish: Competition Orange<br>
</p>
<h5 class="subtitle">Neck & Fingerboard</h5>
<p>
Neck: Maple<br>
Profile: "C"<br>
Scale Length: 25.5"<br>
Fingerboard: Laurel<br>
Radius: 9.5"<br>
Frets: 21 Medium Jumbo<br>
Inlays: Pearloid Dots<br>
Nut: Synthetic Bone<br>
Nut Width: 1.6"<br>
</p>
</div>
<div id="contacts">
<hr>
<h3 class="title">Contact us</h3>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<label for="name" id="name">Name</label>
<input type="text" name="name" class="textInputs" placeholder="John Smith" required>
<label for="email">Email</label>
<input type="email" name="email" class="textInputs" id="email" placeholder="johnsmith@gmail.com" required>
<label for="msg">Message</label>
<textarea name="msg" id="msgBox" cols="30" rows="10" required></textarea>
<input type="submit" id="submit">
</form>
</div>
</div>
<footer>
<div id="footer-content">
<a href="#">Privacy</a>
<a href="#">Terms</a>
<p>Copyright 2020, Fender</p>
</div>
</footer>
</body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');
* {
padding: 0;
margin: 0;
}
html {
scroll-behavior: smooth;
}
body {
font-family: 'Noto Sans KR', sans-serif;
color: #3F3F3F;
min-width: 320px;
}
hr {
border: 2px solid #4A4A4A;
}
/* Header and navigation */
header {
width: 100%;
position: fixed;
top: 0;
background-color: #E7E7E7;
padding: 5px 0 0 0;
font-size: 12px;
z-index: 1;
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.4);
}
#header-content {
width: 95%;
margin: auto;
}
#header-img {
display: block;
width: 50px;
margin: auto;
}
nav {
text-align: center;
padding: 5px 0 0 0;
}
nav ul li {
display: inline;
}
nav a {
text-decoration: none;
padding: 0 0 0 20px;
color: #3F3F3F;
}
.nav-link:hover {
color: black;
}
.wrapper {
margin: 60px auto 0;
width: 95%
}
/* Landing section */
main {
padding-top: 20px;
}
#video {
width: 100%;
}
main h3 {
font-size: 25px;
}
#price {
font-size: 20px;
margin-bottom: 15px;
}
main h4 {
font-size: 20px;
}
#features {
font-size: 13px;
}
.guitarPics {
display: flex;
}
.guitarPics img {
width: 45%;
margin: 15px auto 15px;
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.4);
border-radius: 10px;
}
/* Buttons */
.btn {
background-color: #4A4A4A;
border-radius: 20px;
margin: 10px auto 0;
width: 150px;
}
.btn:hover {
cursor: pointer;
}
.btn p {
text-align: center;
font-size: 15px;
padding: 10px;
color: white;
}
/* Description */
#description {
margin: 50px 0 50px;
padding-top: 77px;
}
.title {
font-size: 20px;
margin-bottom: 10px;
}
.subtitle {
font-size: 14px;
margin-top: 8px;
}
#description p {
line-height: 20px;
font-size: 13px;
}
/* Specifications */
#specs p {
line-height: 20px;
font-size: 13px;
}
#specs {
padding-top: 78px;
}
/* Contacts */
#contacts {
margin-top: 50px;
padding-top: 78px;
}
form label {
display: block;
font-size: 14px;
margin-top: 10px;
}
.textInputs {
width: 100%;
margin-top: 3px;
height: 35px;
border: none;
border-radius: 5px;
background-color: #E7E7E7;
box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.4);;
}
form textarea {
max-width: 100%;
min-width: 100%;
min-height: 90%;
width: 100%;
margin-top: 3px;
height: 35px;
border: none;
border-radius: 5px;
background-color: #E7E7E7;
box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.4);;
height: 100px;
}
#submit {
border: none;
display: block;
margin: 20px auto 0;
background-color: #4A4A4A;
border-radius: 20px;
margin: 20px auto;
width: 100px;
font-size: 15px;
padding: 10px 0;
color: white;
}
#submit:hover {
cursor: pointer;
}
/* Footer */
footer {
background-color: #E7E7E7;
width: 100%;
font-size: 10px;
padding: 2px 0;
}
#footer-content {
width: 95%;
margin: auto;
}
footer a {
display: block;
}
@media only screen and (min-width: 768px) {
.wrapper, #header-content, #footer-content {
width: 80%;
}
header {
padding: 5px 0;
}
header img {
float: left;
}
header ul {
float: right;
padding: 7px 0;
}
header ul li {
font-size: 14px;
padding: 0 0 0 35px;
}
}
@media only screen and (min-width: 1200px) {
.wrapper {
width: 75%;
}
header {
padding: 10px 0;
}
.nav-link {
font-size: 16px;
}
#header-img {
width: 80px;
}
#header-content {
width: 75%;
}
#video {
width: 50%;
float: left;
margin-right: 15px;
}
#mainText {
font-size: 32px;
}
#price {
font-size: 28px;
}
#main-content h4 {
font-size: 22px;
}
#features {
font-size: 15px;
}
#main-content {
margin-bottom: 110px;
}
.guitarPics img {
width: 40%;
height: auto;
}
#contacts {
width: 60%;
}
#footer-content {
width: 75%;
font-size: 12px;
}
}
// !! 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