HTML: The Parts That Matter
A short reference for what HTML is actually doing, written for the point where you have opened a text editor and want to know what you are typing.
Tags and elements
The whole language is tags and elements.
- A tag is the angle brackets,
<and>, wrapped around an element name. - The element is the instruction — it tells the browser how to display the content.
- Most elements have an opening and a closing tag. The only difference between the two is that the closing tag starts with a
/. - Void elements are the exception.
metaandimghave no closing tag, because there is no content to wrap.
So <p> opens a paragraph, </p> closes it, and <img> stands alone.
What HTML is for
HTML does the structure and nothing else:
- Display content on a page
- Set links for navigation
- Create ordered and unordered lists
- Display images
- Create tables and forms
The two you will reach for constantly
<strong>makes text bold — and it means "this matters", not just "make it heavy".<em>makes text italic, with the same distinction: it marks emphasis.
Both carry meaning as well as appearance, which is why they are preferred over purely visual tags. A screen reader can act on <strong>; it cannot act on something that is merely styled bold.
The simplest possible page
The most basic way to make a web page is to open a text editor and save the file with a .html extension. The main page of any site is always index.html — that is the file a server looks for when someone requests a directory.
Where the other two come in
That is genuinely most of what you need to build one simple page with HTML alone. The other two do the rest:
- CSS styles a page or a site.
- JavaScript controls the behaviour of a page or a site.
Structure, then appearance, then behaviour — in that order, and they stay separate for a reason.