Back to Tutorials
HTML / CSS

Build a Landing Page

Create a clean, responsive landing page using only HTML and CSS - no frameworks, no libraries needed.

~45 mins Beginner HTML + CSS
What You'll Build
  • A navbar with logo & links
  • A hero section with heading & button
  • A features/cards section
  • A footer
  • Fully mobile responsive
Requirements
  • VS Code (or any text editor)
  • A browser (Chrome recommended)
  • No installations needed
Step 1

Set Up Your Files

  1. Create a new folder called my-landing-page
  2. Inside it, create two files: index.html and style.css
  3. Open the folder in VS Code
Install the Live Server extension in VS Code - right-click your HTML file and click "Open with Live Server" to see changes instantly in the browser.
Step 2

HTML Structure

Paste this into your index.html:

index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>My Landing Page</title>
  <link rel="stylesheet" href="style.css" />
</head>
<body>

  <!-- NAVBAR -->
  <nav class="navbar">
    <div class="logo">MyBrand</div>
    <ul class="nav-links">
      <li><a href="#hero">Home</a></li>
      <li><a href="#features">Features</a></li>
      <li><a href="#contact">Contact</a></li>
    </ul>
  </nav>

  <!-- HERO -->
  <section class="hero" id="hero">
    <h1>Welcome to <span>MyBrand</span></h1>
    <p>We build amazing things for amazing people.</p>
    <a href="#contact" class="btn">Get Started</a>
  </section>

  <!-- FEATURES -->
  <section class="features" id="features">
    <h2>Why Choose Us</h2>
    <div class="cards">
      <div class="card">
        <h3>⚡ Fast</h3>
        <p>We deliver projects quickly without compromising quality.</p>
      </div>
      <div class="card">
        <h3>💰 Affordable</h3>
        <p>Budget-friendly pricing for students and startups.</p>
      </div>
      <div class="card">
        <h3>🎯 Reliable</h3>
        <p>100% on-time delivery with full support included.</p>
      </div>
    </div>
  </section>

  <!-- CONTACT -->
  <section class="contact" id="contact">
    <h2>Get In Touch</h2>
    <p>Email us at <a href="mailto:hello@mybrand.com">hello@mybrand.com</a></p>
  </section>

  <!-- FOOTER -->
  <footer>
    <p>© 2026 MyBrand. All rights reserved.</p>
  </footer>

</body>
</html>
Step 3

Add the CSS

Paste this into your style.css:

style.css
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', sans-serif;
  color: #0f172a;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e3a8a;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
  transition: color 0.2s;
}

.nav-links a:hover { color: #2563eb; }

/* HERO */
.hero {
  text-align: center;
  padding: 100px 20px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 16px;
}

.hero h1 span { color: #7dd3fc; }

.hero p {
  font-size: 1.1rem;
  opacity: 0.85;
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  background: white;
  color: #1e3a8a;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 100px;
  transition: transform 0.2s;
}

.btn:hover { transform: translateY(-2px); }

/* FEATURES */
.features {
  padding: 80px 20px;
  background: #f8faff;
  text-align: center;
}

.features h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 40px;
  color: #1e3a8a;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.3s;
}

.card:hover { box-shadow: 0 8px 30px rgba(30,58,138,0.12); }

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card p { font-size: 0.9rem; color: #64748b; }

/* CONTACT */
.contact {
  padding: 80px 20px;
  text-align: center;
}

.contact h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #1e3a8a;
}

.contact a { color: #2563eb; font-weight: 600; }

/* FOOTER */
footer {
  background: #1e3a8a;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .navbar { padding: 14px 20px; }
  .nav-links { gap: 14px; }
  .cards { grid-template-columns: 1fr; }
}
Step 4

Open in Browser

  1. Right-click index.html → Open with Live Server (or just double-click to open in browser)
  2. You should see a full landing page with navbar, hero, cards, and footer
  3. Resize the browser window - the cards will stack on mobile automatically
Press F12 in Chrome to open DevTools. Click the mobile icon (top-left of DevTools) to preview how your page looks on a phone.
Step 5

Try It Yourself - Challenges

Previous Tutorial All Tutorials