Structure of the Web
HTML (HyperText Markup Language) is the skeleton of every web page. It defines the structure and meaning of content.
Structure (Skeleton)
Presentation (Skin/Clothes)
Behavior (Muscles/Brain)
HTML describes what something is, not how it looks. Use CSS for styling, JavaScript for behavior.
| Element | Purpose | Required? |
|---|---|---|
<!DOCTYPE html> |
Tells browser this is HTML5 | Yes |
<html lang="en"> |
Root element + language | Yes |
<head> |
Metadata, links, title | Yes |
<meta charset> |
Character encoding | Yes |
<meta viewport> |
Mobile responsiveness | Yes |
<title> |
Browser tab text | Yes |
<body> |
Visible page content | Yes |
Semantic HTML gives meaning to your markup, not just presentation.
Accessibility
(Screen readers)
SEO
(Search engines)
Maintainability
(Readable code)
Consistency
(Default styling)
| Element | Use For | Don't Use For |
|---|---|---|
<header> |
Introductory content, nav | Just any top section |
<nav> |
Primary navigation links | All lists of links |
<main> |
Dominant content (1 per page) | Sidebar, footer content |
<article> |
Self-contained content (blog post, card) | Layout containers |
<section> |
Thematic grouping with heading | Generic styling wrapper |
<aside> |
Tangentially related content | Just side placement |
<footer> |
Footer for section or page | Bottom of any div |
<figure> |
Image with caption | Every image |
HTML5 provides powerful built-in form validation and new input types.
Single-line text
minlength, maxlength, patternEmail validation
Built-in format checkHidden input
pattern for complexityPhone number
pattern for formatNumeric values
min, max, stepDate picker
min, max attributesSlider control
min, max, stepColor picker
Returns hex valueSearch field
Clear button includedFile upload
accept, multiple, captureWeb address
Validates URL formatMultiple selections
checked, required<option value=""> with optgroup
rows, cols, maxlength attributes
Group related controls (radio buttons)
Store data invisible to users (CSRF tokens)
alt text (empty for decorative: alt="")width and height to prevent layout shift (CLS)loading="lazy" for below-fold imagesalt text
<label> elements
<html> element
Requirements: