A complete quick-reference for the most essential HTML elements and attributes. Angle brackets < > denote tags; replace placeholder text with your own content.
StructureTextLinks & MediaListsLayoutTablesForms
01Document Structure🏗️
<!DOCTYPE html>
Document type declarationAlways the first line. Tells the browser to use modern HTML5 rules. No closing tag.
<html>
Root elementWraps the entire page. Use lang="en" to declare language.
<head>
Metadata containerHolds invisible info about the page — title, charset, CSS links. Nothing inside renders visibly.
<body>
Visible content containerEverything users actually see goes here. One per page.
<title>
Browser tab titleAppears in the tab, bookmarks, and search results. Goes inside <head>.
02Inside <head>🔧
<meta charset="UTF-8">
Character encodingEnsures special characters display correctly. Always include this first in <head>.
<meta name="viewport" …>
Mobile viewportMakes the page scale correctly on phones. Essential for responsive design.
<meta name="description">
SEO descriptionThe snippet that appears under page title in Google search results.
<link rel="stylesheet">
Link a CSS fileAttaches external styles to the page using the href attribute.
<script src="…">
Link a JS fileLoads a JavaScript file. Often placed just before </body> for performance.
03Text & Headings📰
<h1> – <h6>
Headingsh1 = most important (use once per page). h2–h6 are sub-headings in descending importance.
<p>
ParagraphStandard block of text. Browsers add spacing above and below automatically.
<strong>
Bold / important textRenders bold and signals importance to screen readers. Use for genuine emphasis.
<em>
Italic / emphasised textRenders italic and signals stress emphasis. Different meaning from just styling text.
<span>
Inline containerNo visual effect on its own — used with CSS/JS to target a piece of inline text.
<br>
Line breakForces a new line within a paragraph. Void element — no closing tag.