HTML - HyperText Markup Language

How is HTML Structured?

HTML or HyperText Markup Language is a markup language used to structure and display context on web pages. It uses tags to organize and define elements.

Tags are the special markers in HTML, written using angle brackets < >.
There are two types of tags : tag pairs (e.g., <p></p>, and self-closing tags (e.g., <br />).

Tags follow the nesting principle : you can place any tags inside other tag pairs, aslong as they dont overlap or cross each other.

The Doctype and Page Structure

A doctype is a declaration that tells the browser which version of html is used. In HTML, page follows a precise structure based on the Doctype :

<!DOCTYPE html>

<html>
<head></head>

</body></body>
</html>

An HTML page always follows this order : doctype → html → head → body. This structure is essential for correct page display.

<!DOCTYPE html>

This line indicates to the browser that the page uses HTML5, the latest major version of HTML used to build modern web pages.

<html></html>

This tag pair contains the entire web page and defines the document as HTML. It's the root element that wraps all the content of an HTML document.

<head></head>

A section that contains metadata and instructions for the browser. They are loaded before the web page.

</body></body>

A section that contains the content displayed on the screen.