A Brief Detour: HTML

Learn about HTML, the language understood by all browsers!

HTML

HTML (HyperText Markup Language) is the language used by browsers to display content. So many of the nice-looking websites we run into look that way because HTML tells them exactly how to format the displayed text.

An HTML element

The big idea is that HTML uses these elements to mark up parts of the text. These elements then say how to modify that marked text or how to use it for other purposes.

Each element has an opening angular bracket (<), followed by the name of that tag, followed by a closing angular bracket (>), like so: <html>, <head>, <body>, and <title>.

Let’s see how these elements are applied to other texts!

Tags

An HTML element is applied to a text by enclosing it between an opening and closing tag, like so:

<b> Ruby </b>

The above is an instruction to display “Ruby” in bold. Here, <b> is the opening tag, and </b> is the closing tag.

In general, the closing tag is exactly like the opening tag but with an extra slash before the tag name.

The </html>, </head>, </body>, and </title> elements are examples of closing tags.

Some basic elements

Here are some basic elements that are foundational to static webpage development:

  • The entire document must be enclosed between the <html> </html> tags.

  • Everything visible to the user is enclosed within the <body> </body> tags.

Notice how the following html file has <head> and <body> elements nested within the <hmtl> element.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy