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.
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
</head>
<body>
<header>
<!-- Restaurant Logo -->
<a href="#" class="logo">Zam Resto</a>
<!-- Web Navigation -->
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#menus">Menus</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<!-- Hero Section -->
<section class="home" id="home">
<div class="home-title">
<h1>Enjoy the taste</h1>
<h2>What do you want to eat today ?.</h2>
<a href="#" class="btn">Explore the menu</a>
</div>
<div class="home-image">
<img src="hero-section-logo.png" alt="Hero Section Logo">
</div>
</section>
<!-- About -->
<section class="about" id="about">
<div class="about-image">
<img src="about-image.png" alt="About Us Image">
</div>
<div class="about-description">
<span>About</span>
<h2>We're here</h2>
<p></p>
<a href="#" class="btn">Learn more</a>
</div>
</section>
<!-- Menus -->
<section class="menus" id="menus">
<div class="menu-heading">
<span>Our menus</span>
<h2>isiskshfeigb</h2>
<ul class="filter">
<li class="filter-btn active">
<h3>All</h3>
</li>
<li class="filter-btn">
<h3>Appetizer</h3>
</li>
<li class="filter-btn">
<h3>Main Course</h3>
</li>
<li class="filter-btn">
<h3>Dessert</h3>
</li>
<li class="filter-btn">
<h3>Snack & Beverage</h3>
</li>
</ul>
</div>
<div class="menu-container">
<div class="box">
<img src="salad-yunani.png" alt="Salad Tomat">
<h3>Greek Israel Caprese Salad</h3>
<div class="star">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="price">$15.00</div>
<a href="#"><button class="box-btn">Order now</button></a>
</div>
<div class="box">
<img src="california-sushi-sashimi.png" alt="California Sushi">
<h3>California Roll Sushi Sashimi Gimbap Canapé</h3>
<div class="star">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="price">$15.00</div>
<a href="#"><button class="box-btn">Order now</button></a>
</div>
<div class="box">
<img src="hyderabadi-biryani-ayam.png" alt="Nasi Biryani">
<h3>Hyderabadi Biryani Ayam</h3>
<div class="star">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="price">$15.00</div>
<a href="#"><button class="box-btn">Order now</button></a>
</div>
<div class="box">
<img src="rogan-josh-karahi-naan.png" alt="Ayam Karahi">
<h3>Rogan Josh Karahi Naan</h3>
<div class="star">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="price">$15.00</div>
<a href="#"><button class="box-btn">Order now</button></a>
</div>
<div class="box">
<img src="gelato-fudge.png" alt="Ice Cream Gelato Fudge">
<h3>Ice Cream Cafe Gelato Fudge</h3>
<div class="star">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="price">$15.00</div>
<a href="#"><button class="box-btn">Order now</button></a>
</div>
<div class="box">
<img src="tiramisu-cake.png" alt="Tiramisu Cake">
<h3>Tiramisu Cake</h3>
<div class="star">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="price">$15.00</div>
<a href="#"><button class="box-btn">Order now</button></a>
</div>
</div>
</section>
<!-- Services -->
<section class="services" id="services">
<div class="heading">
<span>Services</span>
<h2>We provide best quality food</h2>
</div>
<div class="services-container">
<div class="services-box">
<div class="order">
<img src="order.png" alt="order">
<h3>Order</h3>
<p>Lorem ipsum dolor sit amet.</p>
</div>
</div>
<div class="services-box">
<div class="shipping">
<img src="shipping.png" alt="shipping">
<h3>Shipping</h3>
<p>Lorem ipsum dolor sit amet.</p>
</div>
</div>
<div class="services-box">
<div class="delivery">
<img src="delivery.png" alt="delivery">
<h3>Delivery</h3>
<p>Lorem ipsum dolor sit amet.</p>
</div>
</div>
</div>
</section>
<!-- Contact Us -->
<section class="contact" id="contact">
<div class="reservation">
<div class="form-title">
<h1><span><img src="art-1.png" alt=""></span>Make a Reservation<span><img src="art-1.png" alt=""></span></h1>
<p>Book your table now and have a great meal!</p>
</div>
<div class="main-form">
<form action="" method="">
<div>
<span>Full name<span class="required">*</span></span>
<input type="text" name="name" id="name" placeholder="Write your name here..." required>
</div>
<div>
<span>Email<span class="required">*</span></span>
<input type="email" name="name" id="name" placeholder="Write your email here..." required>
</div>
<div>
<span>How many people ?<span class="required">*</span></span>
<select name="people" id="people" required>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<div>
<span>Time<span class="required">*</span></span>
<input type="time" name="time" id="time" placeholder="time" required>
</div>
<div>
<span>Date<span class="required">*</span></span>
<input type="date" name="date" id="date" placeholder="date" required>
</div>
<div>
<span>Phone Number<span class="required">*</span></span>
<input type="number" name="number" id="number" placeholder="Write your number here..." required>
</div>
<div id="submit"><input type="submit" value="SUBMIT" id="number">
</div>
</form>
</div>
</div>
</section>
<footer>
<section class="container">
<div class="footer-left">
<a href="#" class="title">Zam Resto</a>
<p><strong>Zam Resto</strong> is a traditional Indonesian restaurant that provides a variety of dishes and snacks typical of the archipelago.</p>
</div>
<div class="footer-center">
<i class="fa fa-phone"></i>
<p>(024)-566-355</p>
<div>
<i class="fa fa-envelope"></i>
<p>info@zamresto.com</p>
</div>
<div>
<i class="fa fa-map-marker" aria-hidden="true"></i>
<p><a href="#">Jl. Batursari, Tambak Dalam Raya, Semarang, Indonesia.</a></p>
</div>
</div>
<div class="footer-right">
<h4>NEWSLETTER</h4>
<p>Subscribe now so you don't miss attractive promotions</p>
<input type="email">
<button type="submit">Subscribe</button>
<ul class="social-media">
<li><a href="#"><i class="fa fa-globe"></i></a></li>
<li><a href="#"><i class="fa fa-instagram"></i></a></li>
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
</ul>
</div>
<hr>
</section>
<p class="copyright">Copyright © 2023 <strong>Zam Resto</strong> All rights reserved</p>
</footer>
</body>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
scroll-behaviour: smooth;
list-style: none;
text-decoration: none;
}
:root {
--main-color: #ff702a;
--text-color: #fff;
--bg-color: #1e1c2a;
--big-font: 5rem;
--h2-font: 2.25rem;
--p-font: 0.9rem;
}
*::selection {
background-color: var(--main-color);
color: #fff;
}
body {
color: var(--text-color);
background: var(--bg-color);
}
/* Hero Section */
header {
position: relative;
top: 0;
right: 0;
width: 100%;
z-index: 1000;
display: flex;
align-items: center;
justify-content: space-between;
padding: 30px 105px;
background: var(--bg-color);
}
.logo {
color: var(--main-color);
font-weight: 600;
font-size: 2.4rem;
}
nav ul {
display: flex;
}
nav a {
color: var(--text-color);
font-size: 1.1rem;
padding: 10px 20px;
font-weight: 500;
}
nav a:hover {
color: var(--main-color);
transition: 0.4s;
}
/* Hero Section */
section {
padding: 70px 17%;
}
.home {
width: 100%;
min-height: 90vh;
display: grid;
grid-template-columns: repeat (2, 1fr);
grid-gap: 1.5rem;
align-items: center;
}
.home-image img {
max-width: 100%;
width: 600px;
height: auto;
}
.home-title h1 {
font-size: var(--big-font);
color: var(--main-color);
}
.home-title h2 {
font-size: var(--h2-font);
margin: 0.1rem 0 2rem;
}
.btn {
display: inline-block;
padding: 10px 20px;
background: var(--main-color);
color: #ffffff;
border-radius: 0.5rem;
}
.btn:hover {
transform: scale(1.2) translateY(10px);
transition: 0.4s;
}
/* About Us Section */
.about {
display: grid;
grid-template-columns: repeat (2, 2fr);
grid-gap: 1.5rem;
align-items: center;
background: #feeee7;
}
.about-image img {
max-width: 100%;
width: 480px;
height: auto;
}
.about-image img[alt] {
color: #000000;
}
.about-description span {
color: #000000;
font-weight: 600;
}
.about-description h2 {
color: var(--main-color);
font-size: var(--h2-font);
margin: 0.1rem 0 2rem;
}
.about-description p {
color: #000000;
margin: 0.8rem 0 1.8rem;
line-height: 1.7;
}
/* Menus Section */
.menu-heading {
text-align: center;
}
.menu-heading span {
color: var(--main-color);
font-size: 2em;
font-weight: 600;
}
.menu-heading h2 {
font-size: var(--h2-color);
margin-bottom: 25px;
}
.menu-heading .filter {
display: flex;
align-items: center;
justify-content: space-around;
flex-wrap: wrap;
padding: 1rem 0;
border-top: 0.3rem dashed #3f71ea;
border-bottom: 0.3rem dashed #3f71ea;
}
.filter-btn {
border: 1px solid #feeee7;
border-radius: 5rem;
margin-top: 1rem;
padding: 25px;
background: none;
outline: none;
cursor: pointer;
margin: 0.2em;
}
.filter-btn.active {
background-color: var(--main-color);
}
.filter-btn:hover {
background-color: #3f71ea;
}
.box-btn {
border: 2px solid var(--main-color);
border-radius: 5rem;
margin-top: 1rem;
padding: 10px;
background: none;
color: #000000;
cursor: pointer;
}
.menu-container {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}
.menu-container .box {
background: #ffffff;
width: 15rem;
padding: 1.5rem;
margin: 1.5rem;
border-radius: 1rem;
box-shadow: 0 0.3rem 0.5rem rgba(0, 0, 0, 0.2);
text-align: center;
}
.menu-container .box img {
height: 20rem;
width: 100%;
object-fit: cover;
}
.menu-container .box h3 {
color: #333333;
font-size: 1.5rem;
font-weight: normal;
}
.menu-container .box .star {
color: yellow;
font-size: 1.7rem;
padding: 1rem 0.1rem;
}
.menu-container .box .price {
color: #333333;
font-size: 1.4rem;
}
.menu-container .box:hover {
transform: scale(1.02);
box-shadow: 0 1rem 1rem blur rgba(0, 0, 0, 0.2);
}
/* Services Section */
.services {
background: #feeee7;
}
.heading {
text-align: center;
}
.heading span {
color: var(--main-color);
font-weight: 600;
}
.heading h2 {
color: #000000;
}
.services-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, auto));
grid-gap: 1.5rem;
margin-top: 4rem;
}
.services-box {
text-align: center;
padding: 20px 30px;
}
.services-box img {
width: 90px;
}
.services-box h3 {
margin: 4px 0 10px;
color: var(--main-color);
font-size: 1.2rem;
}
.services-box p {
color: #000000;
line-height: 1.7;
}
/* Contact Section */
.contact {
margin: 0 auto;
max-width: 1280px;
height: 800px;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
}
.reservation {
width: 650px;
}
.form-title {
text-align: center;
margin: 0 0 40px 0;
}
.form-title h1 {
color: #fff;
font-size: 40px;
margin-bottom: 20px;
}
.form-title p {
color: #fff;
font-size: large;
}
.form-title h1 span img {
margin: 0 10px;
}
.main-form div {
margin: 10px 10px;
width: 300px;
display: inline-block;
}
.main-form div input {
margin-top: 10px;
width: 100%;
background: none;
border: 1px solid #ffca00;
font-size: 20px;
color: #fff;
outline: none;
padding: 3px 0 3px 10px;
}
.main-form div select {
margin-top: 10px;
width: 104%;
background: none;
border: 1px solid #ffca00;
font-size: 20px;
color: #fff;
outline: none;
padding: 3px 0 3px 10px;
}
.main-form div span {
width: 100%;
font-size: 25px;
color: #fff;
}
.main-form div span .required {
color: red;
margin-left: 2.5px;
}
#submit {
width: 100%;
text-align: center;
}
#submit input {
width: 200px;
background-color: yellow !important;
color: black !important;
transition: all 0.3s;
}
#submit input:hover {
width: 200px;
background-color: black !important;
color: #fff !important;
}
#submit input:active {
font-size: 19px;
background-color: rgb(46, 20, 5) !important;
color: #fff !important;
}
/* Footer Section */
footer {
width: 100%;
position: relative;
bottom: 0;
font-size: 13px;
line-height: 20px;
}
.container {
background-color: #2d2a30;
box-sizing: border-box;
width: 100%;
display: flex;
flex-wrap: wrap;
flex-basis: 25%;
align-items: flex-start;
justify-content: space-between;
text-align: left;
font: bold 16px sans-serif;
padding: 10px;
margin: auto;
}
.footer-left .footer-center .footer-right {
display: inline-block;
vertical-align: top;
}
.footer-left {
width: 30%;
}
.title {
color: var(--main-color);
font-weight: 600;
font-size: 2.4rem;
width: 210px;
}
.footer-center {
width: 35%;
}
.footer-center i {
background-color: #33383b;
color: #ffffff;
font-size: 25px;
width: 38px;
height: 38px;
border-radius: 50%;
text-align: center;
line-height: 42px;
margin: 10px 15px;
vertical-align: middle;
}
.footer-center i.fa-envelope {
font-size: 17px;
line-height: 38px;
}
.footer-center p {
max-width: 240px;
}
.footer-center p {
display: inline-block;
color: #ffffff;
vertical-align: middle;
margin: 0;
}
.footer-center p a {
color: var(--main-color);
}
.footer-right {
width: 35%;
}
.footer-right h4 {
color: var(--main-color);
margin-top: 15px;
}
.footer-right p {
font-size: 12px;
}
.footer-right input {
margin-top: 10px;
height: 40px;
width: 17vw;
padding: 0 15px;
outline: none;
}
.footer-right button {
height: 40px;
width: 5rem;
outline: none;
color: var(--main-color);
background-color: var(--bg-color);
border: none;
cursor: pointer;
}
.footer-right button:hover {
color: #feeee7;
background-color: #3f71ea;
}
.social-media {
margin-top: 25px;
display: flex;
}
.social-media a {
display: block;
width: 35px;
height: 35px;
cursor: pointer;
background-color: #33383b;
border-radius: 2px;
font-size: 20px;
color: #ffffff;
text-align: center;
line-height: 35px;
margin: 0 8px;
}
.social-media a:hover {
background-color: #3f71ea;
}
.container hr {
width: 100%;
border: 0;
border-bottom: 1px solid #ccc;
margin-top: 20px;
}
/* Copyright */
.copyright {
background-color: #2d2a30;
text-align: center;
}
Also see: Tab Triggers