HTML is the language that gives every web page its structure. Every site you visit, from a school blog to a large online shop, is built on it. In this lesson you will learn what HTML is, how it fits with the other web technologies, and what you need to start writing it.
By the end you will be able to:
- Explain what HTML stands for and what it does
- Describe how HTML, CSS and JavaScript work together
- Recognise a tag, an element and an attribute
- Set up a free text editor and a browser to practise
What is HTML?
HTML stands for HyperText Markup Language. It is a markup language, which means you use it to label content (this is a heading, this is a paragraph, this is a link) rather than to write programs with logic and calculations. The browser reads your labels and decides how to display them.
The three building blocks of the web
- HTML gives the page its structure and content
- CSS controls the style: colours, fonts and layout
- JavaScript adds behaviour: menus, animations and interactivity
Think of a house. HTML is the walls and rooms, CSS is the paint and furniture, and JavaScript is the electricity. This course focuses on the walls and rooms.
Tags, elements and attributes
HTML uses tags written inside angle brackets. Most tags come in pairs: an opening tag and a closing tag with a slash. Together with the content between them they make an element.
<p>Hello, world!</p>
Here <p> is the opening tag, </p> is the closing tag, and the whole line is a paragraph element.
Tags can carry extra information called attributes, written inside the opening tag as name="value".
<a href="https://example.com">Visit Example</a>
In this example href is the attribute and the web address is its value.
What you need to get started
- A text editor. Visual Studio Code is free and recommended. Notepad also works.
- A web browser such as Chrome, Firefox, Edge or Safari
- A folder on your computer called html-course where you will save all your files
You do not need to install a server or pay for anything. HTML files open directly in your browser.
Key points to remember
- HTML describes the structure of a page, it does not style it
- Most elements have an opening tag, content and a closing tag
- Attributes add extra information to a tag