HTML tags describe the meaning and structure of web content. Learning them as a huge alphabetical list is less useful than knowing which element matches a document problem. The most important distinctions are semantic versus purely presentational content, interactive controls versus static text, and valid nesting versus markup that browsers silently repair.
Start with an actual document skeleton
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Study Notes</title>
</head>
<body>
<main><h1>Study Notes</h1><p>One useful explanation.</p></main>
</body>
</html>
The document type activates standards mode; lang identifies the language; metadata declares encoding and viewport behavior. The title is browser metadata, while a visible heading belongs in the body.
Headings and landmarks communicate hierarchy
Use header, main, nav, article, section and footer where their meanings apply. A heading level describes position in a document outline, not font size. Use CSS for appearance; do not turn every bold phrase into a new h2.
Lists, tables and code are different content
Use ul or ol for lists of comparable items. Use a table with header cells for genuinely tabular relationships, not for page layout. Use pre and code for source examples that need preserved whitespace.
<h2>Example commands</h2>
<pre><code>python --version
python -m pip --version</code></pre>
Links and images need accessible context
An anchor should describe its destination, not just say “click here”. An image needs alternative text that conveys its meaning; a decorative image may use an empty alt attribute. Do not put untrusted URL fragments directly into HTML attributes without correct escaping and validation.
Form controls must have names
<form>
<label for="query">Search exams</label>
<input id="query" name="query" type="search" required>
<button type="submit">Search</button>
</form>
A placeholder is not a replacement for a persistent label. Native buttons, inputs and links already support many keyboard interactions. Rebuilding them with clickable divs creates unnecessary accessibility work.
Void elements and valid nesting
img, input, br and meta are void elements in HTML; they do not have a separate closing tag. An anchor cannot contain another anchor, and a paragraph cannot contain block content arbitrarily. Validate output because browsers may repair malformed nesting differently than an author expected.
Modern HTML beats obsolete presentation tags
Use CSS instead of old font and center tags. Use strong for importance, em for stress emphasis, and b/i only when their non-emphasis semantics fit. The HTML living standard explains content models and semantics; check it before copying a legacy tag into a modern production page.