Lesson 1.2 Introduction to HTML

HTML files

HTML source code is stored in a text file (with the extension .html or .htm) which can be opened with any text editor, even when the HTML code is dynamically generated (ie by a computer program). You can read and edit these files with any text editor (NotePap, Notepad, gedit ...).

Markup structure

HTML is a markup language. It means that markup are added in the page content. Markup are also called tags or HTML tags.

The tags start with the symbol << and end with >>, they serve to inform the browser how to interpret the content. The general structure of a tag is described by the following diagram:

General structure of HTML markup

In this example, the text contained in the tag is wrapped between an opening and closing tag. Note that in sometime there is no closing tag. For example: <br> (line break) has only one opening tag.

Optional attributes can be added to define properties applied to the tag and its descendants (other tags encapsulated in it).


Here is an example of HTML source code and how it is rendered in the browser:

<h1>Bicycles are great</h1>
Three reasons to ride a bicyle

    <li>It does not pollute</li>
    <li>It keeps you in shape</li>
    <li>It's cheaper than a car</li>

When the previous code is interpreted by the browser, it displays the following page:

The previous example illustrates some common tags:


Create a HTML file titled "I like, I hate". Add two subtitles (heading 2) named "I like" and "I hate". Under the first one, add and unordered list with thinks you like. Under the second title, add an ordered list with stuff you don't like.

See also

Last update : 03/10/2022