Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • JS Tutorial
  • JS Exercise
  • JS Interview Questions
  • JS Array
  • JS String
  • JS Object
  • JS Operator
  • JS Date
  • JS Error
  • JS Projects
  • JS Set
  • JS Map
  • JS RegExp
  • JS Math
  • JS Number
  • JS Boolean
  • JS Examples
  • JS Free JS Course
  • JS A to Z Guide
  • JS Formatter
Open In App
Next Article:
Design a Webpage like Technical Documentation using HTML and CSS
Next article icon

How to create a Landing page using HTML CSS and JavaScript ?

Last Updated : 07 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

A landing page, also referred to as a lead capture page, static page, or destination page, serves a specific purpose and typically appears as a result of online advertising or search engine optimization efforts. Unlike a homepage, a landing page is stripped of distractions and focuses on capturing visitor information through a form, while reassuring them that the website can address their needs. In this article, we are going to create a landing page using HTML, CSS, and JavaScript.

Create a captivating landing page that converts your target audience into high-paying customers in just a few clicks with Instapage. It is an easy-to-use landing page builder that lets you build a landing page of your choice without any coding.

How Landing page is different from a Home Page?

The landing page is a single web page that appears in response to clicking on a search engine-optimized search result or any online advertisement and the Home page is the initial or the main web page of a website. The landing page acts as the front door to the website and the Home page acts as the expressway to the visitor's desired destination.

Approach

  • Create the basic layout of the landing page using HTML that includes a basic nav bar, a basic homepage a body section, and a signup page.
  • Style the layout created by HTML using CSS and link the CSS file to the HTML file.
  • Create an index.js file and write the JavaScript code to display the nav bar in a sliding menu when the website is viewed on small screens

Example: In this example, we will be creating a landing page using HTML, CSS, and JavaScript.

HTML
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content=         "width=device-width, initial-scale=1.0">     <link rel="stylesheet" href="index.css">     <title>Landing Page</title> </head>  <body>     <nav>         <div class="heading">Landing Page</div>         <span class="sideMenuButton"              onclick="openNavbar()">             &#9776         </span>          <div class="navbar">             <ul>                 <li><a href="#Home">Home</a></li>                 <li><a href="#">About</a></li>                 <li><a href="#">Sign Up</a></li>             </ul>         </div>     </nav>      <!-- Side navigation bar for          responsive website -->     <div class="sideNavigationBar"          id="sideNavigationBar">         <a href="#" class="closeButton"              onclick="closeNavbar()">             &#x274C         </a>         <a href="#">Home</a>         <a href="#">About</a>         <a href="#">Sign Up</a>     </div>      <!-- Content -->     <div class="line" id="Home">         <div class="side1">             <h1>GeeksforGeeks</h1>             <button>                 <a href= "https://www.geeksforgeeks.org/">                     Explore More                 </a>             </button>         </div>         <div class="side2">             <img src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20220401124017/HTML-Tutorial.png"                 width="500">         </div>     </div>      <section class="about" id="My Projects">         <div class="content">             <div class="title">                 <span>Courses</span>             </div>             <div class="boxes">                 <div class="box">                     <div class="topic">                         <a href="" target="_blank">                             DSA                         </a>                     </div>                     <p>                         The term DSA stands for Data                          Structures and Algorithms. As                          the name itself suggests, it                          is a combination of two                          separate yet interrelated                          topics.                     </p>                 </div>                 <div class="box">                      <div class="topic">                         <a href="" target="_blank">                             HTML                         </a>                     </div>                     <p>                         HTML stands for HyperText                          Markup Language. It is used                          to design web pages using                          the markup language.                     </p>                 </div>                  <div class="box">                     <div class="topic">                         <a href="" target="_blank">                             Javascript                         </a>                     </div>                     <p>                         JavaScript (JS) is the most                          popular lightweight, interpreted                          compiled programming language.                     </p>                 </div>             </div>         </div>     </section>      <section class="contact" id="contact">         <div class="content">             <div class="title"><span>Sign Up</span></div>             <div class="contactMenu">                 <div class="input1">                     <div class="label1">Your Name</div>                     <div class="input2">                         <input type="text"                              placeholder="Enter your Name here">                     </div>                     <div class="label1">                         <label>Your Email</label>                     </div>                     <div class="input2">                         <input type="text"                              placeholder="Enter your Email here">                     </div>                     <div class="label1">                         <label>Your Password</label>                     </div>                     <div class="input2">                         <input type="text"                              placeholder="Enter your Password here">                     </div>                     <div class="button">                         <button>Sign Up</button>                     </div>                 </div>                 <div class="input3">                     <div class="rightside1">                         <div class="title1">                             <span>                                 Contact Us                             </span>                         </div>                         <div class="content1">                             A-143, 9th Floor, Sovereign                              Corporate Tower, Sector-136,                              Noida, Uttar Pradesh - 201305                         </div>                         <div class="title1">                             <span>More Information</span>                         </div>                         <div class="content1">                             Greetings to all the Geeks out there!                             We welcome you to the platform where we                             consistently strive to offer the best                              of education. This platform has been                              designed for every geek wishing to                              expand their knowledge, share their                              knowledge and is ready to grab their                              dream job. We have millions of articles,                             live as well as online courses, thousands                              of tutorials and much more just for the                              geek inside you.Thank you for choosing                              and supporting us!                         </div>                     </div>                 </div>             </div>         </div>     </section>     <!-- Footer section -->     <footer>         <div class="footer">             <span>                 Created By                 <a href="https://www.geeksforgeeks.org/"                      target="_blank">                     GeeksforGeeks                 </a>             </span>         </div>     </footer>     <script src="index.js"></script> </body>  </html> 
CSS
* {     padding: 0;     margin: 0;     box-sizing: border-box; }  body {     background-color: white;     color: black;     font-family: "Fira Sans", sans-serif;     background-color: white; }  nav {     width: 100%;     height: 80px;     display: flex;     justify-content: space-between;     padding: 20px 5%;     background-color: #8cc099; }  nav .heading {     font-size: 30px;     font-weight: 700;     color: white; }  nav ul {     display: flex;     list-style: none; }  nav ul li {     padding: 8px 15px;     border-radius: 10px;     transition: 0.2s ease-in; }  nav ul li a {     color: black;     font-size: 20px;     font-weight: 500;     text-decoration: none;     color: white; }  nav ul li:hover {     background-color: green; }  nav ul li a:hover {     color: white; }  nav .sideMenuButton {     font-size: 30px;     font-weight: bolder;     cursor: pointer;     display: none; }  /* responsive navbar css */ @media screen and (max-width: 600px) {     nav .sideMenuButton {         display: flex;     }      nav .navbar {         display: none;     }      .sideNavigationBar {         display: block !important;     } }  .sideNavigationBar {     height: 100%;     position: fixed;     top: 0;     right: 0%;     background-color: green;     overflow-x: hidden;     transition: 0.3s ease-in;     padding-top: 60px;     display: none; }  .sideNavigationBar a {     padding: 8px 8px 8px 40px;     display: block;     font-size: 25px;     font-weight: 500;     color: #d1d1d1;     transition: 0.3s;     text-decoration: none; }  .sideNavigationBar a button {     padding: 10px 20px;     border-radius: 10px;     color: green;     font-size: 16px;     border-style: none;     font-weight: 700; }  .sideNavigationBar a:hover {     color: white; }  .sideNavigationBar .closeButton {     position: absolute;     top: 10px;     right: 25px;     font-size: 20px;     margin-left: 50px; }  .line {     display: flex;     justify-content: space-between;     align-items: center;     margin: 2% 5%; }  .line .side1 {     padding-right: 50px; }  .side1 h1 {     font-size: 60px;     margin-bottom: 10px;     color: green; }  .side1 button {     width: 200px;     padding: 12px 20px;     border-radius: 20px;     border-style: none;     color: black;     font-size: 17px;     font-weight: 600; }  a {     text-decoration: none;     color: black; }  /* Header content responsive */ @media screen and (max-width: 980px) {     .side2 img {         width: 350px;     }      .side1 h1 {         font-size: 40px;     }      .side1 p {         font-size: 17px;     }      .line {         margin-top: 80px;     } }  @media screen and (max-width: 600px) {     .side1 h1 {         font-size: 35px;     }      .line {         flex-direction: column;     }      .line .side1 {         padding: 30px;     } }  /* section */  section .topic a {     font-size: 25px;     font-weight: 500;     margin-bottom: 10px; }  .about .boxes {     display: flex;     flex-wrap: wrap;     justify-content: space-between; }  .about .boxes .box {     margin: 10px 20px;     max-width: calc(100% / 3 - 50px);     text-align: center;     border-radius: 12px;     padding: 30px 10px;     box-shadow: 0 5px 10px rgba(0, 0, 0, 0.12);     cursor: default; }  /* Contact Page  */  .contact {     padding: 20px; }  .contact .content {     margin: 0 auto;     padding: 30px 0; }  .content .title {     width: 80%;     text-align: center;     font-weight: bolder;     font-size: 40px; }  .title {     margin-bottom: 30px;     margin-left: 80px; }  .contactMenu {     display: flex;     justify-content: space-evenly; }  .input2 {     margin-top: 10; }  .label1 {     font-size: 18px;     margin-top: 8px;     margin-bottom: 8px;     font-weight: bolder; }  .contactMenu .input1 input {     border-radius: 13px;     padding: 6px; }  .input2 input {     border-color: rgb(252, 244, 244);     width: 400px; }  .button {     margin-top: 12px;     margin-left: 5px; }  .button button {     width: 162px;     height: 35px;     border-radius: 12px;     border-color: transparent; }  .button button:hover {     background-color: #8cc099; }  button {     width: 162px;     height: 35px;     border-radius: 12px;     border-color: transparent; }  button:hover {     background-color: #8cc099; }  .rightside1 {     display: flex;     flex-direction: column;     margin-left: 300px; }  .title1 {     font-size: 18px;     margin-top: 8px;     margin-bottom: 5px;     font-weight: bolder; }  .content1 {     width: 450px;     margin-top: 2px;     color: grey; }  /* Footer */ footer {     background: var(--primary-color);     padding: 15px 0;     text-align: center;     font-family: "Poppins", sans-serif; }  footer .footer span {     font-size: 17px;     font-weight: 400;     color: var(--white-color); }  footer .footer span a {     font-weight: 500;     color: var(--white-color); }  footer .footer span a:hover {     text-decoration: underline; }  @media screen and (max-width: 1060px) {     .contactMenu {         flex-direction: column;         align-items: center;     }      .rightside1 {         display: flex;         flex-direction: column;         margin-left: 0px;     }      .content1 {         width: 100%;         margin-top: 2px;         color: grey;     }      .side2 img {         width: 95%;         height: 90%;     } }  @media screen and (max-width: 600px) {     .side2 img {         width: 100%;     }      section .topic a {         font-size: 20px;     }      section .topic p {         font-size: 5px;     }      .about .boxes {         display: flex;         flex-direction: column;         align-items: center;     }      .about .boxes .box {         max-width: 70%;     } } 
JavaScript
function openNavbar() {     document.getElementById("sideNavigationBar")         .style.width = "50%"; } function closeNavbar() {     document.getElementById("sideNavigationBar")         .style.width = "0%"; } 

Output:

How to create a Landing page using HTML, CSS, and JavaScript?
How to create a Landing page using HTML, CSS, and JavaScript?

Next Article
Design a Webpage like Technical Documentation using HTML and CSS

A

amitsingh2730
Improve
Article Tags :
  • JavaScript
  • Web Technologies
  • JavaScript-Projects
  • Spotlight

Similar Reads

    How to Create a Website Using HTML and CSS?
    Creating a website using HTML and CSS is a foundational skill if you are learning web development. HTML (HyperText Markup Language) is used to structure content, while CSS (Cascading Style Sheets) is used for styling, including colors, fonts, margins, and positioning. In this article, we’ll go throu
    5 min read
    Design a Tribute Page using HTML and CSS
    Making a tribute page is an Innovative way to honor someone special in your life. In this article, we create a tribute webpage using HTML and CSS. This page has a simple and creative design. It contains a header with a title, a main section with text and images, and a footer for main details or cred
    4 min read
    Build a Survey Form using HTML and CSS
    Creating a survey form is a great way to understand the basics of web development. In this article, we will build a Survey Form that allows users to easily submit their responses. The form will include different input types such as text fields, checkboxes, and radio buttons, all designed using HTML
    4 min read
    Design a Parallax Webpage using HTML and CSS
    A parallax website includes fixed images in the background that are kept in place and the user can scroll down the page to see different parts of the image. In this article, we are creating a parallax webpage using HTML and CSS. We will use basic tags of HTML like div, paragraph, and heading to writ
    4 min read
    Design an Event Webpage using HTML and CSS
    Creating an event webpage is an exciting way to showcase information about an event, including its schedule, speakers, and contact details. What We’re Going to CreateWe’ll create a webpage for a fictional event called "GeeksforGeeks TechCon 2025." This webpage will includeA header introducing the ev
    5 min read
    Design a Webpage for online food delivery system using HTML and CSS
    Creating your own online food delivery website is a great way to present a user-friendly platform for customers to browse and order food online. In this project, we’ll design a simple yet effective food delivery website using HTML and CSS.What We’re Going to Create...We’ll develop a straightforward
    7 min read
    Create a Homepage for Restaurant using HTML , CSS and Bootstrap
    HTML: HTML stands for Hyper Text Markup Language. It is used to design web pages using a markup language. HTML is a combination of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within the tag which defines the s
    6 min read
    How to create a Landing page using HTML CSS and JavaScript ?
    A landing page, also referred to as a lead capture page, static page, or destination page, serves a specific purpose and typically appears as a result of online advertising or search engine optimization efforts. Unlike a homepage, a landing page is stripped of distractions and focuses on capturing v
    7 min read
    Design a Webpage like Technical Documentation using HTML and CSS
    In this article, we will design a webpage-like technical documentation using HTML and CSS . Technical documentation is any document that explains the features of the respective product. In this project, we are going to create technical documentation of C++ by using HTML and CSS. The webpage has a me
    9 min read
    Create a Music Website Template using HTML, CSS & JavaScript
    A Music Website Template is a pre-designed layout for creating a music-themed webpage. By utilizing HTML, CSS, and JavaScript, developers can craft a functional and visually appealing website with features like play/pause controls, sections for home, music, about, and contact.Step-by-Step Guide to c
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences