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/clouds/100/000000/moka-pot.png" alt="Moka Pots Logo"/>
<h1>Bubble's Moka Pots</h1>
<nav id="nav-bar">
<ul>
<li><a class="nav-link" href="#Features"> Features</a></li>
<li><a class="nav-link" href="#How-it-works">How it works</a></li>
<li><a class="nav-link" href="#Pricing"> Pricing</a></li>
</ul>
</nav>
</header>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<h2> Tasty coffees with Bubble's</h2>
<input
name="email"
id="email"
type="email"
placeholder="Enter your email adress" required/>
<input
id="submit"
type="submit"
value="Get contact"/>
</form>
<div class="container">
<section id="Features">
<div class="list">
<div class="icon">
<img src="https://i.ibb.co/3B5rYYN/iconfinder-weather-01-1530392.png" width="auto" height="100px"></div>
<div class="desc">
<h2>Premium Materials</h2>
<p>
Bubble's Moka Pots are made by using the shiniest steel which is sourced locally. This will increase the longevity of your purchase.
</p>
</div>
</div>
<div class="list">
<div class="icon"><img src="https://i.ibb.co/hRF2QWg/iconfinder-602-Launch-mission-shuttle-startup-publish-3957391-2.png" width="auto" height="100px"></div>
<div class="desc">
<h2>Fast Shipping</h2>
<p>
We make sure you recieve your moka pots in 1-2 business days. We also provide free returns if you are not satisfied.
</p>
</div>
</div>
<div class="list">
<div class="icon"><img src="https://i.ibb.co/31MZbXG/iconfinder-food-food-and-restaurant-take-away-Paper-cup-coffee-cup-coffee-shop-hot-drink-coffee-4848458.png" width="auto" height="100px"></div>
<div class="desc">
<h2>Quality Assurance</h2>
<p>
For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your moka pots. You will only enjoy with your coffee made by Bubble's Moka Pot.
</p>
</div>
</div>
</section>
<section id="How-it-works">
<iframe id="video" width="560" height="315" src="https://www.youtube.com/embed/1vr9ShzbFeY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</section>
<section id="Pricing">
<div class="product">
<div class="level">Small Moka Pot</div>
<h2>$15</h2>
<ol>
<li>3 cups coffee</li>
<li>Great size for couples</li>
<li>3 colors options</li>
<li>Fireproof and soft-textured handle</li>
</ol>
<button class="btn">Select</button>
</div>
<div class="product">
<div class="level">Medium Moka Pot</div>
<h2>$20</h2>
<ol>
<li>4 cups coffee</li>
<li>Great size for double shot lover couples</li>
<li>3 colors options</li>
<li>Fireproof and soft-textured handle</li>
</ol>
<button class="btn">Select</button>
</div>
<div class="product">
<div class="level">Large Moka Pot</div>
<h2>$30</h2>
<ol>
<li>6 cups coffee</li>
<li>Great size for sharing</li>
<li>2 colors options</li>
<li>Fireproof and soft-textured handle</li>
</ol>
<button class="btn">Select</button>
</div>
</section>
<footer>
<dic class="copyright"> © 2020, Bubble's Moka Pots
<div class="contact"> <a href="#">Privacy</a>
<a href="#">Terms</a>
<a href="#">Contact</a>
</div>
</footer>
</div>
@import url('https://fonts.googleapis.com/css2?family=Cabin+Sketch&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@700&family=Cabin+Sketch&display=swap');
body {
background-color: rgb(195, 155, 211, 0.5);
font-family: 'Cabin Sketch', cursive;
}
li {
list-style: none;
}
.container {
max-width: 1000px;
width: 100%;
margin: 0 auto;
}
.btn {
padding:0 20px;
margin-top: 10px;
margin-bottom: 10px;
height: 40px;
font-size: 20px;
font-weight: 900;
border: 1px black solid;
border-radius: 2px;
font-family: 'Amatic SC', cursive;
background-color: rgb(88, 214, 141, 0.5);
}
.list {
display: flex;
}
header {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
min-height: 75px;
display: flex;
align-items: center;
background-color: #FAD7A0;
}
@media (max-width: 600px) {
header {
flex-wrap: wrap;
}
}
.icon {
width: auto;
height: 100px;
display: flex;
padding: 15px;
}
.desc {
margin-top: 15px;
}
#How-it-works {
margin-top: 50px;
display: flex;
justify-content: center;
}
#How-it-works > iframe {
max-width: 560px;
}
#Pricing {
margin-top: 60px;
display: flex;
flex-direction: row;
justify-content: center;
}
.product {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
width: calc(100% / 3);
margin: 10px;
border: 1px solid #000;
border-radius: 4px;
}
.level {
color: black;
padding-top: 15px;
width: 100%;
text-transform: uppercase;
font-weight: 700;
}
footer {
display: flex;
margin-top: 50px;
justify-content: center;
}
footer .copyright {
display: flex;
}
footer .contact {
padding-left: 50px;
}
a {
color: white;
text-decoration: none;
padding: 15px;
}
#nav-bar a:hover {
background-color: rgb(88, 214, 141, 0.5);
}
nav {
font-weight: 400;
padding-left: 500px;
}
@media (max-width: 1155px) {
nav {
margin-top: 10px;
background-color-size: auto;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 0 50px;
}
nav li {
padding-bottom: 5px;
}
}
nav > ul {
width: 25vw;
display: flex;
flex-direction: row;
justify-content: space-around;
}
@media (max-width: 650px) {
nav > ul {
flex-direction: column;
}
}
#form {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
height: 200px;
margin-top: 125px;
}
#form input[type="email"] {
max-width: 275px;
width: 100%;
padding: 5px;
}
#form input[type="submit"] {
max-width: 150px;
width: 100%;
height: 30px;
margin: 15px 0;
border: 0;
font-family: 'Amatic SC', cursive;
font-size: 15px;
background-color: rgb(88, 214, 141, 0.5);
border: 1px black solid;
}
#form input[type="submit"]:hover {
background-color: rgb(88, 214, 141);
transition: background-color;
}
@media (max-width: 650px) {
#form {
margin-top: 120px;
}
@media (max-width: 550px) {
#Features .icon {
display: none;
}
}
@media (max-width: 800px) {
#Pricing {
flex-direction: column;
}
Also see: Tab Triggers