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 URLs 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 its URL and the proper URL extension.
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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<div class="header">
<div class="container">
<div class="navbar">
<div class="logo">
<a href="index.html"><img src="https://i.ibb.co/kDVwgwp/logo.png" alt="RedStore" width="125px" /></a>
</div>
<nav>
<ul id="MenuItems">
<li><a href="index.html">Home</a></li>
<li><a href="product.html">Products</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
<li><a href="account.html">Account</a></li>
</ul>
</nav>
<a href="cart.html"><img src="https://i.ibb.co/PNjjx3y/cart.png" alt="" width="30px" height="30px" /></a>
<img src="https://i.ibb.co/6XbqwjD/menu.png" alt="" class="menu-icon" onclick="menutoggle()" />
</div>
<div class="row">
<div class="col-2">
<h1>
Give Your Workout <br />
A New Style!
</h1>
<p>
Success isn't always about greatness. It's about consistency.
Consistent <br />hard work gains success. Greatness will come.
</p>
<a href="#" target="_blank" rel="noopener noreferrer" class="btn">Explore Now →</a>
</div>
<div class="col-2">
<img src="https://i.ibb.co/QpTmdX5/image1.png" alt="" />
</div>
</div>
</div>
</div>
<!-- Featured categories -->
<div class="categories">
<div class="small-container">
<div class="row">
<div class="col-3">
<img src="https://i.ibb.co/sqnY1pG/category-1.jpg" alt="" />
</div>
<div class="col-3">
<img src="https://i.ibb.co/GCJLQRQ/category-2.jpg" alt="" />
</div>
<div class="col-3">
<img src="https://i.ibb.co/wYsXqP5/category-3.jpg" alt="" />
</div>
</div>
</div>
</div>
<!-- Featured products -->
<div class="small-container">
<h2 class="title">Featured Products</h2>
<div class="row">
<div class="col-4">
<a href="product_details.html"><img src="https://i.ibb.co/47Sk9QL/product-1.jpg" alt="" /></a>
<a href="product_details.html">
<h4>Red Printed T-shirt</h4>
</a>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/b7ZVzYr/product-2.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/KsMVr26/product-3.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/0cMfpcr/product-4.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
</div>
<h2 class="title">Latest Products</h2>
<div class="row">
<div class="col-4">
<img src="https://i.ibb.co/bQ5t8bR/product-5.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/vVpTyBD/product-6.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/hR5FGwH/product-7.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/QfCgdXZ/product-8.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
</div>
<div class="row">
<div class="col-4">
<img src="https://i.ibb.co/nw5xZwk/product-9.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/9HCsmjf/product-10.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/JQ2MBHR/product-11.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<p>₹500.00</p>
</div>
<div class="col-4">
<img src="https://i.ibb.co/nRZMs6Y/product-12.jpg" alt="" />
<h4>Red Printed T-shirt</h4>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<p>₹500.00</p>
</div>
</div>
</div>
<!-- offer -->
<div class="offer">
<div class="small-container">
<div class="row">
<div class="col-2">
<img src="https://i.ibb.co/HF5TncZ/exclusive.png" alt="" class="offer-img" />
</div>
<div class="col-2">
<p>Exclusively Available on RedStore</p>
<h1>Smart Band 4</h1>
<small>The Mi Smart Band 4 features a 39.9% larger (than Mi Band 3)
AMOLED color full-touch display with adjustable brightness, so
everything is clear as can be.</small>
<br />
<a href="#" class="btn">Buy Now →</a>
</div>
</div>
</div>
</div>
<!-- Testimonial -->
<div class="testimonial">
<div class="small-container">
<div class="row">
<div class="col-3">
<i class="fas fa-quote-left"></i>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Perferendis, quae molestias error id est voluptatibus quos amet
numquam aspernatur nam cumque ullam? Veritatis eveniet et, maxime
eaque soluta quas modi.
</p>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<img src="https://i.ibb.co/zfXD2Tx/user-1.png" alt="" />
<h3>Marta W.</h3>
</div>
<div class="col-3">
<i class="fas fa-quote-left"></i>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Perferendis, quae molestias error id est voluptatibus quos amet
numquam aspernatur nam cumque ullam? Veritatis eveniet et, maxime
eaque soluta quas modi.
</p>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<img src="https://i.ibb.co/FVyK1KM/user-2.png" alt="" />
<h3>Rula P.</h3>
</div>
<div class="col-3">
<i class="fas fa-quote-left"></i>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Perferendis, quae molestias error id est voluptatibus quos amet
numquam aspernatur nam cumque ullam? Veritatis eveniet et, maxime
eaque soluta quas modi.
</p>
<div class="rating">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
<i class="far fa-star"></i>
</div>
<img src="https://i.ibb.co/jZ3tQqK/user-3.png" alt="" />
<h3>Vika Z.</h3>
</div>
</div>
</div>
</div>
<!-- brands -->
<div class="brands">
<div class="small-container">
<div class="row">
<div class="col-5">
<img src="https://i.ibb.co/Gfwzz1S/logo-godrej.png" alt="" />
</div>
<div class="col-5">
<img src="https://i.ibb.co/vjrRZFM/logo-oppo.png" alt="" />
</div>
<div class="col-5">
<img src="https://i.ibb.co/3zs234S/logo-coca-cola.png" alt="" />
</div>
<div class="col-5">
<img src="https://i.ibb.co/7Wt343W/logo-paypal.png" alt="" />
</div>
<div class="col-5">
<img src="https://i.ibb.co/GVSNwJD/logo-philips.png" alt="" />
</div>
</div>
</div>
</div>
<!-- Footer -->
<div class="footer">
<div class="container">
<div class="row">
<div class="footer-col-1">
<h3>Download Our App</h3>
<p>Download App for Android and iso mobile phone.</p>
<div class="app-logo">
<img src="https://i.ibb.co/KbPTYYQ/play-store.png" alt="" />
<img src="https://i.ibb.co/hVM4X2p/app-store.png" alt="" />
</div>
</div>
<div class="footer-col-2">
<img src="https://i.ibb.co/j3FNGj7/logo-white.png" alt="" />
<p>
Our Purpose Is To Sustainably Make the Pleasure and Benefits of
Sports Accessible to the Many.
</p>
</div>
<div class="footer-col-3">
<h3>Useful Links</h3>
<ul>
<li>Coupons</li>
<li>Blog Post</li>
<li>Return Policy</li>
<li>Join Affiliate</li>
</ul>
</div>
<div class="footer-col-4">
<h3>Follow us</h3>
<ul>
<li>Facebook</li>
<li>Twitter</li>
<li>Instagram</li>
<li>YouTube</li>
</ul>
</div>
</div>
<hr />
<p class="copyright">Copyright © 2021 - Red Store</p>
</div>
</div>
<!-- js for toggle menu -->
<script>
var MenuItems = document.getElementById('MenuItems');
MenuItems.style.maxHeight = '0px';
function menutoggle() {
if (MenuItems.style.maxHeight == '0px') {
MenuItems.style.maxHeight = '200px';
} else {
MenuItems.style.maxHeight = '0px';
}
}
</script>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Poppins", sans-serif;
}
.navbar {
display: flex;
align-items: center;
padding: 20px;
}
nav {
flex: 1;
text-align: right;
}
nav ul {
display: inline-block;
list-style-type: none;
}
nav ul li {
display: inline-block;
margin-right: 20px;
}
a {
text-decoration: none;
color: #555;
}
p {
color: #555;
}
.container {
max-width: 1300px;
margin: auto;
padding-left: 25px;
padding-right: 25px;
}
.row {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: space-around;
}
.col-2 {
flex-basis: 50%;
min-width: 300px;
}
.col-2 img {
max-width: 100%;
padding: 50px 0;
}
.col-2 h1 {
font-size: 50px;
line-height: 60px;
margin: 25px 0;
}
.btn {
display: inline-block;
background: #ff523b;
color: #ffffff;
padding: 8px 30px;
margin: 30px 0;
border-radius: 30px;
transition: background 0.5s;
}
.btn:hover {
background: #563434;
}
.header {
background: radial-gradient(#fff, #ffd6d6);
}
.header .row {
margin-top: 70px;
}
.categories {
margin: 70px 0;
}
.col-3 {
flex-basis: 30%;
min-width: 250px;
margin-bottom: 30px;
}
.col-3 img {
width: 100%;
}
.small-container {
max-width: 1080px;
margin: auto;
padding-left: 25px;
padding-right: 25px;
}
.col-4 {
flex-basis: 25%;
padding: 10px;
min-width: 200px;
margin-bottom: 50px;
transition: transform 0.5s;
}
.col-4 img {
width: 100%;
}
.title {
text-align: center;
margin: 0 auto 80px;
position: relative;
line-height: 60px;
color: #555;
}
.title::after {
content: "";
background: #ff523b;
width: 80px;
height: 5px;
border-radius: 5px;
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-50%);
}
h4 {
color: #555;
font-weight: normal;
}
.col-4 p {
font-size: 14px;
}
.rating .fas {
color: #ff523b;
}
.rating .far {
color: #ff523b;
}
.col-4:hover {
transform: translateY(-5px);
}
/* Offer */
.offer {
background: radial-gradient(#fff, #ffd6d6);
margin-top: 80px;
padding: 30px 0;
}
.col-2 .offer-img {
padding: 50px;
}
small {
color: #555;
}
/* testimonial */
.testimonial {
padding-top: 100px;
}
.testimonial .col-3 {
text-align: center;
padding: 40px 20px;
box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: transform 0.5s;
}
.testimonial .col-3 img {
width: 100px;
margin-top: 20px;
border-radius: 50%;
}
.testimonial .col-3:hover {
transform: translateY(-10px);
}
.fa-quote-left {
font-size: 34px;
color: #ff523b;
}
.col-3 p {
font-size: 14px;
margin: 12px 0;
color: #777777;
}
.testimonial .col-3 h3 {
font-weight: 600;
color: #555;
font-size: 16px;
}
.brands {
margin: 100px auto;
}
.col-5 {
width: 160px;
}
.col-5 img {
width: 100%;
cursor: pointer;
filter: grayscale(100%);
}
.col-5 img:hover {
width: 100%;
cursor: pointer;
filter: grayscale(0);
}
/* footer */
.footer {
background: #000;
color: #8a8a8a;
font-size: 14px;
padding: 60px 0 20px;
}
.footer p {
color: #8a8a8a;
}
.footer h3 {
color: #ffffff;
margin-bottom: 20px;
}
.footer-col-1,
.footer-col-2,
.footer-col-3,
.footer-col-4 {
min-width: 250px;
margin-bottom: 20px;
}
.footer-col-1 {
flex-basis: 30%;
}
.footer-col-2 {
flex: 1;
text-align: center;
}
.footer-col-2 img {
width: 180px;
margin-bottom: 20px;
}
.footer-col-3,
.footer-col-4 {
flex-basis: 12%;
text-align: center;
}
ul {
list-style-type: none;
}
.app-logo {
margin-top: 20px;
}
.app-logo img {
width: 140px;
}
.footer hr {
border: none;
background: #b5b5b5;
height: 1px;
margin: 20px 0;
}
.copyright {
text-align: center;
}
.menu-icon {
width: 28px;
margin-left: 20px;
display: none;
}
/* media query for menu */
@media only screen and (max-width: 800px) {
nav ul {
position: absolute;
top: 70px;
left: 0;
background: #333;
width: 100%;
overflow: hidden;
transition: max-height 0.5s;
}
nav ul li {
display: block;
margin-right: 50px;
margin-top: 10px;
margin-bottom: 10px;
}
nav ul li a {
color: #fff;
}
.menu-icon {
display: block;
cursor: pointer;
}
}
/* all products page */
.row-2 {
justify-content: space-between;
margin: 100px auto 50px;
}
select {
border: 1px solid #ff523b;
padding: 5px;
}
select:focus {
outline: none;
}
.page-btn {
margin: 0 auto 80px;
}
.page-btn span {
display: inline-block;
border: 1px solid #ff523b;
margin-left: 10px;
width: 40px;
height: 40px;
text-align: center;
line-height: 40px;
cursor: pointer;
}
.page-btn span:hover {
background: #ff523b;
color: #ffffff;
}
/* single product details */
.single-product {
margin-top: 80px;
}
.single-product .col-2 img {
padding: 0;
}
.single-product .col-2 {
padding: 20px;
}
.single-product h4 {
margin: 20px 0;
font-size: 22px;
font-weight: bold;
}
.single-product select {
display: block;
padding: 10px;
margin-top: 20px;
}
.single-product input {
width: 50px;
height: 40px;
padding-left: 10px;
font-size: 20px;
margin-right: 10px;
border: 1px solid #ff523b;
}
input:focus {
outline: none;
}
.single-product .fas {
color: #ff523b;
margin-left: 10px;
}
.small-img-row {
display: flex;
justify-content: space-between;
}
.small-img-col {
flex-basis: 24%;
cursor: pointer;
}
/* cart items */
.cart-page {
margin: 90px auto;
}
table {
width: 100%;
border-collapse: collapse;
}
.cart-info {
display: flex;
flex-wrap: wrap;
}
th {
text-align: left;
padding: 5px;
color: #ffffff;
background: #ff523b;
font-weight: normal;
}
td {
padding: 10px 5px;
}
td input {
width: 40px;
height: 30px;
padding: 5px;
}
td a {
color: #ff523b;
font-size: 12px;
}
td img {
width: 80px;
height: 80px;
margin-right: 10px;
}
.total-price {
display: flex;
justify-content: flex-end;
}
.total-price table {
border-top: 3px solid #ff523b;
width: 100%;
max-width: 400px;
}
td:last-child {
text-align: right;
}
th:last-child {
text-align: right;
}
/* account page */
.account-page {
padding: 50px 0;
background: radial-gradient(#fff, #ffd6d6);
}
.form-container {
background: #ffffff;
width: 300px;
height: 400px;
position: relative;
text-align: center;
padding: 20px 0;
margin: auto;
box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.form-container span {
font-weight: bold;
padding: 0 10px;
color: #555555;
cursor: pointer;
width: 100px;
display: inline-block;
}
.form-btn {
display: inline-block;
}
.form-container form {
max-width: 300px;
padding: 0 20px;
position: absolute;
top: 130px;
transition: transform 1s;
}
form input {
width: 100%;
height: 30px;
margin: 10px 0;
padding: 0 10px;
border: 1px solid #ccc;
}
form .btn {
width: 100%;
border: none;
cursor: pointer;
margin: 10px 0;
}
form .btn:focus {
outline: none;
}
#LoginForm {
left: -300px;
}
#RegForm {
left: 0;
}
form a {
font-size: 12px;
}
#Indicator {
width: 100px;
border: none;
background: #ff523b;
height: 3px;
margin-top: 8px;
transform: translateX(100px);
transition: transform 1s;
}
/* media query for less than 600 screen size */
@media only screen and (max-width: 600px) {
.row {
text-align: center;
}
.col-2,
.col-3,
.col-4 {
flex-basis: 100%;
}
.single-product .row {
text-align: left;
}
.single-product .col-2 {
padding: 20px 0;
}
.single-product h1 {
font-size: 26px;
line-height: 32px;
}
.cart-info p {
display: none;
}
}
Also see: Tab Triggers