Most people learn HTML twice. The first time they learn the tags, build something that looks right, and conclude that HTML is the easy part. The second time — usually after a screen reader user cannot use their form, or a search engine ignores their page, or a colleague asks why the whole layout is forty nested divs — they learn what the tags actually mean. This article is an attempt to skip the gap between those two. It is not a list of elements; that list is in every reference and you do not need another one. It is about the handful of decisions in HTML that have consequences, what those consequences are, and how to tell whether you have made them well. HTML is not a programming language, and that is the point You will see this said as a put-down, usually by someone who has just discovered JavaScript. It is true and it is not an insult. HTML has no variables, no loops and no conditionals, because it is not describing behaviour. It is describing what things are. That distinction is the whole subject. When you write:
Read our refund policy.
you are not telling the browser to render some text at a certain size with some space underneath. You are telling it: this is a paragraph. Everything else — the size, the spacing, the font — follows from that, and can be changed by CSS, by the user's own settings, by a reading-mode extension, or by a screen reader that does not render anything visually at all. This is why HTML is described as a *markup* language. You are marking up meaning. The appearance is a downstream consequence, and it is the least important consumer of what you wrote. Hold on to that, because almost every mistake in this article is the same mistake: choosing an element for how it looks instead of what it means. The browser will forgive you, and that is the problem Open a page with unclosed tags, mismatched nesting, a, or a table with no
, and the browser will render it anyway. It will not show an error. It will quietly build the best document it can from what you gave it and move on. This error recovery is deliberate and it is, on balance, a good thing — the web would be unusable if a stray tag produced a blank page. But it has a side effect that catches every beginner: bad HTML looks like it works. It looks like it works in your browser, on your machine, with your eyes. What it does not do is work for the other consumers of your page, and those consumers never file a bug report: • a screen reader, which navigates by headings, landmarks and labels rather than by position; • a search engine, which reads your structure to decide what the page is about; • reader mode, which tries to find the article and throws away the rest; • a future version of your own codebase, where somebody needs to restyle something and cannot find the seam. None of these will tell you that you got it wrong. The page will simply underperform for reasons nobody connects to the markup. That is why the rest of this article is worth your time: these are the failures you cannot see from where you are sitting. Semantics: the same page, two different documents Consider two versions of the same visual layout.Our Courses
Learning HTML
Start here.
With the right CSS these render identically. Pixel for pixel, a sighted user cannot tell them apart. To everything else they are completely different documents. The first one is a flat bag of generic boxes: nothing in it says what is a heading, what is the main content, or where one item ends and the next begins. The second one is a document with a title, a main region, and an article inside it. A screen reader user on the second page can jump straight to the main content, list every heading to get an overview, and skip the navigation they have already heard on six other pages. On the first page, none of those commands do anything, because there is nothing to find. They have to listen to the page linearly, from the top, every time. A through are the most commonly misused elements in HTML, and the reason is that they come with default font sizes. People pick the heading that looks the right size, which is like choosing chapter numbers based on how big the ink is.
Headings are a document outline. They should nest the way a table of contents nests:
Learning HTML
Text and structure
Paragraphs
Lists
Forms
Inputs
Two rules follow, and both have real consequences:
Do not skip levels. Going from straight to because was too big tells assistive technology there is a missing section. Use CSS to set the size; that is what CSS is for.
One `` per page, naming what the page is about. Not the site name — the page. A search engine, a reader-mode parser and a screen reader all use it to answer "what is this?"
The test for whether your headings are right is to read only the headings, in order, and ask whether they describe the page. If they read like a sensible contents page, your structure is sound. If they read like a random list of phrases, your structure is decorative.
Links and buttons are not interchangeable
This is the single most common mistake in production code, and it is worth understanding precisely because the fix is so cheap.
A link navigates. A button acts.
Browse courses
Learning HTML
Text and structure
Paragraphs
Lists
Forms
Inputs
Two rules follow, and both have real consequences: Do not skip levels. Going from straight to because was too big tells assistive technology there is a missing section. Use CSS to set the size; that is what CSS is for.
One `` per page, naming what the page is about. Not the site name — the page. A search engine, a reader-mode parser and a screen reader all use it to answer "what is this?"
The test for whether your headings are right is to read only the headings, in order, and ask whether they describe the page. If they read like a sensible contents page, your structure is sound. If they read like a random list of phrases, your structure is decorative.
Links and buttons are not interchangeable
This is the single most common mistake in production code, and it is worth understanding precisely because the fix is so cheap.
A link navigates. A button acts.
Browse courses
was too big tells assistive technology there is a missing section. Use CSS to set the size; that is what CSS is for.
One `` per page, naming what the page is about. Not the site name — the page. A search engine, a reader-mode parser and a screen reader all use it to answer "what is this?"
The test for whether your headings are right is to read only the headings, in order, and ask whether they describe the page. If they read like a sensible contents page, your structure is sound. If they read like a random list of phrases, your structure is decorative.
Links and buttons are not interchangeable
This is the single most common mistake in production code, and it is worth understanding precisely because the fix is so cheap.
A link navigates. A button acts.
Browse courses
Show more Styling one to look like the other is fine — a link can look like a button, that is a visual decision. Using the wrong element underneath is not, because the behaviours differ in ways no amount of CSS restores: • A link can be opened in a new tab, bookmarked, copied, and dragged. A button cannot, because there is nothing to open. • A link is activated with Enter. A button is activated with Enter or Space. Users rely on both. • A screen reader announces them differently, and that announcement is the user's only clue about what is about to happen. "Link, browse courses" sets a different expectation from "button, show more". The worst version is
autocomplete. The browser can fill in a name, an address, a one-time code — but only if you tell it what the field holds. This is one of the highest-value, lowest-effort attributes in HTML and it is almost always missing.
Keep the <form> element and a real submit button. A form that submits on Enter, works before JavaScript loads, and degrades gracefully when a script fails is more robust than one assembled entirely from click handlers. HTML gives you that behaviour free; you have to work to lose it.
Alt text: what it is actually for
alt is not a caption and it is not a keyword slot. It is what the image says, written for someone who cannot see it.
That means the right alt text depends entirely on why the image is there:
Note the middle case. alt="" is not the same as omitting alt. An empty alt says "this image carries no information, move on". A missing alt leaves the screen reader with nothing to announce but the file name, so the user hears "image, swirl dot p n g" — which is noise and tells them nothing.
The useful test: if you had to read the page aloud down a telephone, what would you say when you reached this image? If the answer is "nothing, it is just a decorative flourish", that is alt="". If the answer is a sentence, that sentence is your alt text.
Tables, and the layout myth
"Never use tables for layout" is correct advice that has been over-learned into "never use tables". Tables are the right element for tabular data — rows and columns where the position of a cell carries meaning. A price list, a comparison, a schedule, a set of results.
What makes a table accessible is not the
| Course | Fee |
|---|---|
| HTML | Free |