# Semantic HTML

> Write HTML that describes meaning, not just looks, so browsers, search engines and screen readers understand your pages. Free notes, key concepts, resources...

Canonical: https://www.internhack.in/roadmaps/tracks/full-stack/html
Last updated: 2026-11-28

Write HTML that describes meaning, not just looks, so browsers, search engines and screen readers understand your pages.

Beginner · about 5 hours · difficulty 1/5

Learn first: [HTTP, Requests and Responses](https://www.internhack.in/roadmaps/tracks/full-stack/http-basics)

React and Next.js still output HTML. Good HTML makes your app faster, more accessible and easier to style; bad HTML causes bugs no framework can fix.

### Structure

- Document basics: doctype, head (title, meta viewport, description), body.
- Landmarks: header, nav, main, section, article, aside, footer.
- Headings h1 to h6 in order, one h1 per page.
- Lists, tables (for tabular data only), images with meaningful alt text.

### Forms are where full-stack starts

Forms send data to your backend. Learn label with for, input types (email, number, date, password), required, name attributes, and how a plain form submits a POST without any JavaScript. Next.js server actions build on exactly this behaviour.

### Semantics in practice

Use a button for actions and an anchor for navigation. A div with an onClick is not keyboard accessible and is not announced as a button.

### Pitfalls

- Div soup: everything wrapped in div and span with no meaning.
- Missing labels on inputs, which breaks screen readers and makes click targets tiny.
- Using headings to make text bigger instead of to structure content.

You are ready to move on when you can build a placement registration form and a profile page using only semantic HTML that works with the keyboard alone.

## Key concepts

- **Document structure and meta tags**
- **Landmarks and headings**
- **Links, images and alt text**
- **Forms, labels and input types**
- **Buttons vs links**
- **Tables for tabular data**
- **Open Graph meta tags**

## Mini project

Build a static college fest registration page with a semantic layout and a form (name, roll number, email, event choice) that posts to a test endpoint such as httpbin.org/post.

## Check yourself

Why is a clickable div worse than a button element, even if both look identical after styling?

## Free resources

- [HTML: HyperText Markup Language](https://developer.mozilla.org/en-US/docs/Web/HTML) (MDN)
- [Learn HTML](https://web.dev/learn/html) (web.dev)
- [freeCodeCamp Responsive Web Design](https://www.freecodecamp.org/learn) (freeCodeCamp)

Previous: [Git and GitHub](https://www.internhack.in/roadmaps/tracks/full-stack/git-and-github) · Next: [CSS Fundamentals](https://www.internhack.in/roadmaps/tracks/full-stack/css)

## More in HTML, CSS and Accessible Layout

- [Semantic HTML](https://www.internhack.in/roadmaps/tracks/full-stack/html)
- [CSS Fundamentals](https://www.internhack.in/roadmaps/tracks/full-stack/css)
- [Flexbox, Grid and Responsive Design](https://www.internhack.in/roadmaps/tracks/full-stack/responsive-layout)
- [Web Accessibility Basics](https://www.internhack.in/roadmaps/tracks/full-stack/accessibility)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Full-Stack Developer Roadmap](https://www.internhack.in/roadmaps/tracks/full-stack)
