Chapter 1: HTML and CSS Home
What actually is the “Home” in HTML + CSS world?
The homepage is:
- The very first page almost everyone sees when they type your website address (example: https://www.yourname.com)
- The digital front door of your site
- Usually the place that answers:
- Who are you / what is this website?
- What do you offer?
- Where should I go next? (navigation)
Technically speaking:
Most web servers (Apache, Nginx, Vercel, Netlify, GitHub Pages, etc.) follow this rule:
When someone visits a folder (especially the root folder /) and does not write any filename → the server automatically looks for a special default file.
The most common default names (in this order on most servers):
- index.html
- index.htm
- home.html
- default.html
→ index.html wins almost everywhere today.
So when you type:
|
0 1 2 3 4 5 6 7 |
https://www.example.com/ https://www.example.com |
→ server thinks: “no file name → let me give them index.html”
That’s why we almost always name the homepage file index.html.
Real-life comparison (very Indian style 😄)
Think of your website like your house in Hyderabad:
- The gate + nameplate = domain name (yourname.com)
- The main front door = index.html
- If someone rings the bell and says nothing extra → you open the main door (not the kitchen door or bedroom door)
- If they say “take me to photos” → you open another door (photos.html)
Naming it home.html is like writing “Main Door” on the door instead of just opening the front one — it works only if you tell the server “hey, my default door is called home.html” (possible but extra work and not standard).
Let’s build a proper index.html homepage together (2026 modern style)
Create two files in one folder:
- index.html
- style.css
index.html (copy-paste this)
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Webliance | UI/UX & Web Developer from Hyderabad</title> <!-- Connect CSS --> <link rel="stylesheet" href="style.css" /> <!-- Google Fonts (optional but looks nice) --> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> </head> <body> <!-- ------------------- HEADER / NAVIGATION ------------------- --> <header class="header"> <div class="container"> <a href="/" class="logo">Webliance</a> <nav class="nav"> <a href="#home">Home</a> <a href="#about">About</a> <a href="#projects">Projects</a> <a href="#contact">Contact</a> </nav> </div> </header> <!-- ------------------- HERO SECTION (most important part of homepage) ------------------- --> <section id="home" class="hero"> <div class="container"> <h1>Hello! I'm <span>Webliance</span></h1> <p class="subtitle"> Frontend Developer & UI/UX enthusiast from <strong>Hyderabad</strong>.<br> I build clean, modern, responsive websites. </p> <div class="hero-buttons"> <a href="#projects" class="btn primary">See My Work</a> <a href="#contact" class="btn outline">Get in Touch</a> </div> </div> </section> <!-- ------------------- QUICK ABOUT ------------------- --> <section id="about" class="section"> <div class="container"> <h2>About Me</h2> <p> Currently learning HTML, CSS, JavaScript & loving every bit of it.<br> Goal: Build beautiful, fast websites that people actually enjoy using ☕ </p> </div> </section> <!-- ------------------- FOOTER ------------------- --> <footer> <div class="container"> <p>© 2026 Webliance • Made in Hyderabad with ❤️ & Chai</p> </div> </footer> </body> </html> |
style.css (modern, clean look)
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Inter', system-ui, sans-serif; line-height: 1.6; color: #1a1a1a; background-color: #f9fafb; } .container { max-width: 1100px; margin: 0 auto; padding: 0 20px; } /* Header */ .header { background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; padding: 1rem 0; } .header .container { display: flex; justify-content: space-between; align-items: center; } .logo { font-size: 1.6rem; font-weight: 700; color: #2563eb; text-decoration: none; } .nav a { margin-left: 2rem; text-decoration: none; color: #4b5563; font-weight: 500; } .nav a:hover { color: #2563eb; } /* Hero */ .hero { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; text-align: center; padding: 10rem 0 8rem; } .hero h1 { font-size: 3.5rem; margin-bottom: 1.2rem; } .hero h1 span { color: #fef08a; } .subtitle { font-size: 1.4rem; opacity: 0.95; margin-bottom: 2.5rem; } .btn { display: inline-block; padding: 0.9rem 2rem; border-radius: 50px; font-weight: 600; text-decoration: none; transition: all 0.3s; } .primary { background: white; color: #1e40af; margin-right: 1rem; } .primary:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.15); } .outline { border: 2px solid white; color: white; } .outline:hover { background: white; color: #1e40af; } /* Sections */ .section { padding: 6rem 0; text-align: center; } .section h2 { font-size: 2.8rem; margin-bottom: 2rem; color: #1e40af; } /* Footer */ footer { background: #111827; color: #9ca3af; text-align: center; padding: 3rem 0; font-size: 0.95rem; } |
Save both files → double-click index.html (or open with Live Server in VS Code)
You now have a proper modern homepage!
Quick Summary Table – Homepage vs Normal Page
| Feature | Homepage (index.html) | Other pages (about.html, contact.html etc.) |
|---|---|---|
| File name convention | Almost always index.html | Any name you want |
| URL when visited | example.com/ or example.com/index.html | example.com/about.html |
| Purpose | Welcome + overview + navigation | Specific content |
| Server default | Yes – served automatically | No – must be in URL |
| Should have nav menu? | Usually yes | Usually yes |
| Hero section? | Almost always | Sometimes |
Your mini-challenge today
- Change the name in <h1>Hello! I’m <span>Webliance</span></h1> to something fun
- Add one more link in the nav (example: <a href=”#skills”>Skills</a>)
- Change hero background gradient colors (try #8b5cf6 → #d946ef)
- Add your real photo below the subtitle (use <img src=”your-photo.jpg” alt=”Webliance smiling” class=”avatar”> and style it round)
Tell me how it looks — or say “next → make it mobile friendly” or “add project cards” or “teach Flexbox now” 🚀
Keep building! You’re doing awesome. Chai break ho gaya? ☕😄
