Topic: HTML Basics

Opening and closing tags – HTML

Summary

<p>Text in HTML gets wrapped in opening and closing tags.</p>

Details

HTML code is made up of elements. Many elements (but not all) are made up of opening and closing tags.

The opening tag is made up of the element’s symbol wrapped in angle brackets, like this (this example is for a paragraph element):

<p>

The closing tag is made up of the element’s symbol preceded by a forward slash and wrapped in angle brackets, like this:

</p>

The text you want to display on your web page is placed between the opening and closing tags, like this:

<p>Text goes between the opening and closing brackets.</p>

By default, browsers will render the text differently depending on which element is being used. Here are some examples of different elements you can use to wrap text:

<h1>This text will be rendered as big and bold in the browser.</h1>

<p>This text will be rendered in a normal font size.</p>

<small>This text will be rendered in a small font size.</small>

Demo

References

HTML basics on MDN