AH Dev 101 — Your First Web Page with HTML and CSS | ahdev101.site
Ten tags with their purpose and their place in the document — enough to write a first page that has a heading, text, a link, an image, a list and a small table.
The list below gives ten elements: html, head, body, title, h1, p, a, img, ul/li and table. Each row states the tag, what the element is for, and where it belongs in the document skeleton that starts with the <!DOCTYPE html> declaration.
Three of the ten are containers. The html element wraps the entire document; the head element carries the title and the link to the stylesheet; the body element carries everything a visitor sees. None of the three produces visible output on its own.
Title, h1 and p are text elements. The title element sits in the head and appears in the browser tab. The h1 element is the main heading of the page and sits at the top of the body. The p element holds a paragraph of running text and is the element you will use most often.
On narrow screens, swipe or scroll the plate sideways.
The a element creates a link and takes an href attribute pointing at the destination. The img element embeds an image and needs an alt attribute describing it for visitors who cannot see the image. Both sit in the body.
The ul element holds an unordered list; each item is an li element inside it. The table element holds rows of cells and is the element used for the property tables on this site. Both sit in the body, after the paragraphs they illustrate.
Most of these elements have an opening and a closing tag, and the closing tag must match the opening one. An unclosed p or li element is the failure that makes following content nest incorrectly, which is why the closing tag is worth checking before you save.
Further reading