Introduction to HTML Basics

Introduction to HTML Basics

What is HTML?

HTML (Hypertext Markup Language) is a descriptive language used to mark up specific parts of a web page’s content (a so-called markup language).

Who uses these content markers?

These content markers are used by browsers. Only when they “see” the appropriate HTML tag do they know what type of content they are dealing with (an image, text, and so on) and what they should do with it (that is, how and in what form to display that content).

HTML syntax

HTML uses special markers called tags to mark content. Tags are words wrapped in angle brackets < >.
For a tag to be valid, only selected words may be used, because those words define what effect the tag will have when the browser “reads” it. Most tags come in pairs — an opening tag and a closing tag — with the content they describe placed between them.
An opening tag looks like this: <tagName>
and a closing tag has an extra slash: </tagName>

<h1>This is an example of an "h1" tag used for the main heading</h1>

As mentioned, tags usually have both an opening and a closing tag. However, some tags do not have a closing tag, while others do not have an opening tag — for example the “break” tag, which breaks the text and moves it to the next line: <br>

The structure of an HTML page

HTML declaration

At the top of the file (page) you always place a declaration that tells the browser this is an HTML page: <!doctype html>

The HTML element

After you have “explained” to the browser that this is an HTML page, you add the markers that define the boundaries within which the HTML code is written. Those boundaries are the opening <html> and closing </html> tags.

Head & Body

Everything placed inside the <html> tag is split into two parts: one called <head>, where you put information that is important to the browser (we will explain this later), and another <body>, where you put everything that will actually be visible on the page:

See the most commonly used HTML tags in the article “Basic HTML Tags”