appzasGamesToolsDevLearnCheat sheetsQuick calcsConvertersReferenceNetworkTimeCalculatorsCompareLLM prices

The structure of an HTML page

Lesson 1 of 58 minBeginner

Tags, elements, attributes and the skeleton every page needs.

HTML (HyperText Markup Language) describes the content and structure of a page: headings, paragraphs, links, images, lists. The browser reads it and builds the page. HTML is not a programming language, it is a markup language.

Elements, tags and attributes

An element is usually an opening tag, content and a closing tag. Attributes add information inside the opening tag.

<a href="https://learn.appzas.com/">Free courses</a>

Here a is the element, href is an attribute and "Free courses" is the content. Some elements have no content and no closing tag, such as <img> and <br>.

The skeleton

index.html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>My first page</title>
  </head>
  <body>
    <h1>Hello</h1>
    <p>This is a paragraph.</p>
  </body>
</html>
  • <!doctype html> tells the browser to use modern standards mode.
  • <head> holds information about the page that is not shown: title, character set, links to CSS.
  • <body> holds everything the visitor sees.
  • lang helps screen readers and search engines.

NoteSave the file as index.html and open it in a browser. You do not need a server to start.

Test yourself

Answer all the questions, then check them. Finish with every answer right to mark the lesson as done.

1. Where does the visible content of a page go?
2. In <a href="/x">Go</a>, what is href?
3. Which element is written without a closing tag?

Key terms