All elements are constructed with tags. An element is made up of two tags: an opening tag and a closing tag. The tag begins with a “less than” sign (<)
, then the element name, followed by a “greater than” sign (>)
. All tags are constructed the same way.
For example, the opening and the closing tag for the paragraph element would look like this: <p></p>
<p>This is an HTML paragraph.</p>
Some elements do not use closing tags because they do not enclose content. These are called empty elements. For example, the line break element <br> does not require a closing tag. In the case of empty elements, add a closing slash after the element name, like this: <br />
. When a browser sees the slash, it will recognize the element as one that does not need a separate, closing tag.
<br />
Incorrect: <br/>