Discover what HTML is and learn to recognize a tag and an attribute.
Open this lesson in KodokonWhen you visit a website on your phone or computer, you are using a browser: the program that displays web pages (Chrome, Firefox, Safari...). To know what to display, the browser reads a document written in HTML. HTML stands for HyperText Markup Language. It is not a programming language: it does not compute anything. It is a description language that tells the browser what each piece of content is: "this is a heading", "this is a paragraph", "this is an image".
To describe content, HTML uses tags. A tag is a keyword placed between angle brackets < and >. Most tags work in pairs: an opening tag such as <p>, then the content, then a matching closing tag preceded by a slash: </p>. The whole "opening tag + content + closing tag" is called an element. The name p stands for paragraph.
<p>Hello!</p>
<p>This is my first paragraph.</p>
<p>The text goes between the two tags.</p>A tag can carry extra information called attributes. An attribute always goes inside the opening tag, never the closing one. It is written as name="value": the attribute name, an equals sign, then the value in double quotes. For example, the lang attribute states the language of the content, and the id attribute gives an element a unique identifier.
<p lang="fr">Un paragraphe écrit en français.</p>
<p lang="en">A paragraph written in English.</p>
<p id="conclusion">A paragraph with an identifier.</p>