Swipe left or tap Next ▶ to turn the page.
Select any text to highlight it or add a note. Tap a diagram to enlarge it.
HTML5, Accessibility, Browsers and HTTP
- ✔ Write clean semantic HTML5 pages and explain why each tag was chosen
- ✔ Build forms with the right input types, labels and built-in validation
- ✔ Explain accessibility basics and how a browser turns HTML into pixels
- ✔ Read HTTP requests, responses, status codes and headers with confidence
What the web round checks on Day 1
Interviewers start with the basics because every bug in a React app finally lands in HTML, the browser or HTTP.
A frontend technical round for freshers usually opens with simple questions: "What is semantic HTML?", "What is the difference between GET and POST?", "What happens when you type a URL in the browser?". These sound easy, but many candidates give half answers. Today we build full, clear answers for each of them.
flowchart LR A[You type a URL] --> B[DNS finds the server IP] B --> C[HTTP request sent] C --> D[Server sends HTML] D --> E[Browser builds DOM] E --> F[CSS and JS load] F --> G[Page painted on screen]
"Make the heading red" is about looks, so it belongs to CSS.
"Show a list of five products" is about content and structure, so it belongs to HTML.
"Add the product to the cart when the button is clicked" is behaviour, so it belongs to JavaScript.
Answer: CSS, HTML, JavaScript.
The skeleton of every HTML page
If your skeleton is wrong, the browser silently guesses, and guesses cause strange bugs on other browsers and phones.
Every HTML5 page follows the same basic shape. Learn it by heart, because you may be asked to write it on paper.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ravi's Bookshop</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Welcome to Ravi's Bookshop</h1>
<p>New arrivals every Monday.</p>
<script src="app.js" defer></script>
</body>
</html>
What each line does
| Part | Job |
|---|---|
<!DOCTYPE html> |
Tells the browser to use standards mode, not old "quirks" mode |
<html lang="en"> |
Root element; lang helps screen readers and translators |
<meta charset="UTF-8"> |
Lets ₹, Hindi and Tamil text show correctly |
<meta name="viewport"> |
Makes the page fit phone screens instead of zooming out |
<title> |
Text on the browser tab and in search results |
<body> |
Everything the user actually sees |
A page shows strange characters instead of ₹.
The text is stored correctly, but the browser is reading it with the wrong character encoding.
Add
<meta charset="UTF-8">as one of the first lines inside<head>.Answer: declare UTF-8 encoding early in the head.
Where should the <title> element be placed?
The title is metadata about the page, so it lives in the head. The browser shows it on the tab.
Semantic HTML5: tags with meaning
Semantic tags help Google, screen readers and your teammates understand the page without reading your CSS.
A semantic element tells you what its content is. A <div> says nothing; it is just a box. A <nav> says "this is a set of navigation links". HTML5 added several such elements for page layout.
| Element | Meaning |
|---|---|
<header> |
Intro area of a page or section (logo, title) |
<nav> |
Main group of navigation links |
<main> |
The main content; only one visible per page |
<article> |
Self-contained content that makes sense alone (a blog post, a news item) |
<section> |
A themed group of content, usually with its own heading |
<aside> |
Side content related to the main content (tips, ads) |
<footer> |
Closing area (copyright, contact links) |
A cricket news site shows a match report with its own heading, author and date.
Ask: would this report make sense if posted alone on another site? Yes.
Answer:
<article>.
A recipe page has a box on the right with "Kitchen tips" related to the recipe.
It is related to the main content but not part of the main flow.
Answer:
<aside>.
A developer puts
<main>around both the content and the sidebar, and another<main>around the footer.A page should have only one visible
<main>, holding the unique main content.Remove the second one; keep the sidebar in
<aside>and the footer in<footer>.Answer: one visible
<main>per page.
Keep going with the full course
Day 1 has 21 pages. You have read the first 3.
See what's inside →