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 id="header">
<img id="header-img" src="https://img.icons8.com/external-itim2101-lineal-color-itim2101/64/000000/external-racing-car-car-itim2101-lineal-color-itim2101.png" alt="car icon"/>
<h1 id="header-text"> Custom Car Mods</h1>
<nav id="nav-bar">
<ul>
<li><a class="nav-link" href="#features">Features</a></li>
<li><a class="nav-link" href="#customer">Customer Rides</a></li>
<li><a class="nav-link" href="#pricing">Pricing</a></li>
</ul>
</nav>
</header>
<div>
<h2>Handcrafted engines built with passion</h2>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id="email" type="email" name="email" for="submit" placeholder="Enter your email address"><br>
<button id="submit" name="email" for="submit">Let's go!</button>
</form>
</div>
<a id="features"></a>
<div id="description-div">
<div class="description-group">
<div class="description-img">
<img src="https://img.icons8.com/external-wanicon-lineal-color-wanicon/64/000000/external-engine-car-service-wanicon-lineal-color-wanicon.png" alt="engine icon"/>
</div>
<div class="description-text">
<h3>Overbuilt Engines</h3>
<p class="description-p">We only use parts that are made well above the OEM standard to ensure your vehicle is as reliable as possible.</p>
</div>
</div>
<div class="description-group">
<div class="description-img">
<img src="https://img.icons8.com/external-wanicon-flat-wanicon/64/000000/external-chassis-car-service-wanicon-flat-wanicon.png" alt="drivetrain icon"/>
</div>
<div class="description-text">
<h3>Drivetrain Swap</h3>
<p class="description-p">We can swap the drivetrain of any vehicle to AWD, RWD or FWD to make driving your car a custom experience.</p>
</div>
</div>
<div class="description-group">
<div class="description-img">
<img src="https://img.icons8.com/external-filled-outline-satawat-anukul/64/000000/external-carservice-car-service-filled-outline-filled-outline-satawat-anukul-14.png" alt="turbocharger icon"/>
</div>
<div class="description-text">
<h3>Turbo All The Things</h3>
<p class="description-p">Think of any car, now imagine it with a turbo, or two, or three... or four... or maybe you want a turbo and a supercharger. Yeah we do all that.</p>
</div>
</div>
</div>
<a id="customer"></a>
<div id="video-div">
<iframe id="video" width="560" height="315" src="https://www.youtube-nocookie.com/embed/thZJwl3fX7k" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<a id="pricing"></a>
<div id="cards-div">
<div class="card">
<div class="card-image card1"></div>
<h4>Engine Packages</h4>
<p class="card-p">Whether you just want to make your engine more reliable or add big power, we have the right package options for you.</p>
<button class="button">More Info</button>
</div>
<div class="card">
<div class="card-image card2"></div>
<h4>Drivetrain Packages</h4>
<p class="card-p">We specialize in AWD conversions to make your car faster off the line and overall safer to daily drive but we can also convert your car to RWD or FWD.</p>
<button class="button">More Info</button>
</div>
<div class="card">
<div class="card-image card3"></div>
<h4>Turbo Packages</h4>
<p class="card-p">No matter how much power you want to make, we can make it happen. We also install hidden radar detectors, you know... for science.</p>
<button class="button">More Info</button>
</div>
</div>
<footer>
<ul id="footer-ul">
<li><a href="#">Privacy</a></li>
<li><a href="#">Terms</a></li>
<li><a href="#">Contact</a></li>
<li><a href="https://icons8.com/">Icons by Icons8</a></li>
</ul>
<p id="footer-p">Copyright 2022, Custom Car Mods</p>
</footer>
body {
font-family: 'Montserrat', Tahoma;
margin: 0;
}
#header {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #333;
color: whitesmoke;
position: fixed;
width: 100%;
}
.nav-link {
list-style: none;
display: inline-block;
padding: 0 30px;
}
#nav-bar li {
list-style: none;
display: inline-block;
padding: 0 30px;
}
#features, #customer, #pricing {
scroll-margin-top: 100px;
}
#header-text {
margin-right: auto;
margin-left: 10px;
}
a {
text-decoration: none;
color: whitesmoke;
}
a:hover {
color: rgb(187, 187, 187);
transition: 0.3s;
}
h2 {
text-align: center;
margin-top: 0;
padding-top: 6rem;
}
#form {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
#email {
padding: 7px 25px;
border-radius: 5px;
}
#submit {
padding: 9px 22px;
border-radius: 5px;
color: whitesmoke;
background-color: #900;
border: none;
margin-bottom: 4rem;
}
#submit:hover {
cursor: pointer;
background-color: rgb(105, 0, 0);
transition: 0.3s;
}
.description-group {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 10px 0;
}
.description-text {
width: 50%;
padding-left: 3rem;
}
h3 {
text-align: left;
margin-bottom: 10px;
}
.description-p {
margin-top: 0;
}
#description-img {
display: flex;
justify-content: center;
align-items: flex-start;
}
#video {
display: block;
margin: 4rem auto;
}
#cards-div {
display: flex;
justify-content: center;
}
iframe {
border-radius: 10px;
}
.card {
background-color: #333;
color: whitesmoke;
width: 350px;
height: 400px;
margin: 20px;
border-radius: 10px;
}
.card:hover {
background-color: whitesmoke;
color: #333;
transition: 0.5s;
cursor: pointer;
}
.card-p, h4{
margin: 10px;
}
.card-image {
height: 200px;
margin-bottom: 15px;
background-size: cover;
border-radius: 10px 10px 0 0;
}
.card1 {
background-image: url(https://images.pexels.com/photos/3689314/pexels-photo-3689314.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500);
}
.card2 {
background-image: url(https://images.pexels.com/photos/11097899/pexels-photo-11097899.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260);
}
.card3 {
background-image: url(https://images.unsplash.com/photo-1591879742348-13012c2963bf?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80);
}
.button {
background-color: #900;
color: whitesmoke;
border: none;
border-radius: 5px;
padding: 7px;
margin: 20px auto 0;
display: block;
text-align: center;
cursor: pointer;
}
.button:hover {
background-color: rgb(105, 0, 0);
transition: 0.3s;
}
footer {
background-color: #333;
text-align: right;
width: 90%;
margin: auto;
border-radius: 5px 5px 0 0;
}
footer p {
color: rgb(160, 160, 160);
padding: 5px 15px 5px;
margin-bottom: 0;
}
footer li {
display: inline-block;
list-style: none;
color: whitesmoke;
padding: 15px 15px 0px;
}
#footer-ul {
margin-bottom: 0;
}
@media all and (max-width: 500px) {
#cards-div {
display: block;
}
}
/* I need to learn to mobile first because this is a nightmare doing it the */
/* other way around lol. Next time! */
Also see: Tab Triggers