Day 1: How the Web Works & Your First Page
✅ Today you will learn
- How a website reaches your phone
- What HTML, CSS and JavaScript each do
- Tags, elements and attributes
- The basic HTML page skeleton
- Create and open your first page
🏢 In the real world
Your neighbour runs “Sharma Sweets” and asks: “Can you make a simple website so customers can see our menu and phone number?” In 15 days you will build exactly that – and today you write its very first page.
How the web works
Tags, elements and attributes
<p>Welcome to <strong>Sharma Sweets</strong>!</p> <a href="https://example.com" title="Visit us">Visit our page</a>
| Part | Example | Meaning |
|---|---|---|
| Opening tag | <p> | Start of a paragraph |
| Content | Welcome to … | What the user sees |
| Closing tag | </p> | End (note the /) |
| Element | <p>…</p> | Opening tag + content + closing tag |
| Attribute | href="…" | Extra information inside the opening tag |
| Void element | <br>, <img> | No closing tag and no content |
Close tags in the reverse order you opened them: <p><strong>Hi</strong></p> ✅ – <p><strong>Hi</p></strong> ❌. Think of boxes inside boxes.
The page skeleton
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sharma Sweets – Fresh Mithai in Jaipur</title> </head> <body> <h1>Sharma Sweets</h1> <p>Fresh mithai since 1985. Call us: 98290 12345</p> </body> </html>
| Line | Why it is there |
|---|---|
| <!DOCTYPE html> | Tells the browser: this is modern HTML5 |
| <html lang="en"> | Root element; lang helps Google and screen readers |
| <head> | Information about the page (not shown on the page) |
| <meta charset="UTF-8"> | Shows ₹, हिंदी and emojis correctly |
| <meta name="viewport" …> | Makes the page fit mobile screens |
| <title> | Text on the browser tab and in Google results |
| <body> | Everything the visitor sees |
Make your first page (step by step)
- 1Install VS Code (free) – or use Notepad
- 2Create a folder sharma-sweets
- 3New file → save as index.html
- 4Type ! and press Tab in VS Code to get the skeleton
- 5Write your heading and paragraph
- 6Double-click index.html to open it in Chrome
Install the free “Live Server” extension in VS Code. Right-click index.html → “Open with Live Server”. The page refreshes automatically every time you save.
Comments and whitespace
<!-- This is a comment: browsers ignore it --> <p>Gulab jamun and rasgulla</p> <p>Spaces and new lines inside HTML collapse into one space.</p>
Real example: a tiny business card page
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sharma Sweets – Jaipur</title> </head> <body> <h1>🍬 Sharma Sweets</h1> <p>Fresh mithai, namkeen and festive gift boxes since 1985.</p> <p><strong>Timing:</strong> 8 AM – 10 PM, all days</p> <p><strong>Call:</strong> <a href="tel:+919829012345">98290 12345</a></p> <p><strong>Address:</strong> Johari Bazaar, Jaipur</p> </body> </html>
🏅 Job skills unlocked today
Practice tasks
🏋️ Practice – do it yourself
about.html for yourself: a heading with your name and two paragraphs about your city and hobby.Show solution
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>About Riya</title> </head> <body> <h1>Riya Verma</h1> <p>I live in Indore, the cleanest city in India.</p> <p>My hobby is sketching and I want to become a web designer.</p> </body> </html>
<h1>Menu<h1> <p>Ladoo <strong>₹400/kg</p></strong> <title>Shop</title> (inside body).Show solution
<!-- 1) the closing h1 needs a slash 2) close strong before p 3) title belongs in <head>, not <body> --> <h1>Menu</h1> <p>Ladoo <strong>₹400/kg</strong></p>
Quick quiz
🧠 Quick Quiz – test yourself
Interview corner
💼 Interview Corner
What is the difference between an element and a tag?
A tag is the marker like <p> or </p>. An element is the whole thing: opening tag, content and closing tag (or a single void tag like <img>).
Why is DOCTYPE important?
It switches the browser into standards mode. Without it, old “quirks mode” rules can break layouts.
Summary
- Browser asks a server → gets HTML/CSS/JS → draws the page.
- Element = opening tag + content + closing tag; attributes add details.
- Every page: DOCTYPE, html, head (meta, title), body.
- Save as index.html and open in the browser.
Day 2: headings, paragraphs and text formatting – write the Sharma Sweets “About us” section.
