Html Tags

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.

Note
Tip When writing an empty element, it’s important to add a space between the element name and the closing slash. Correct: <br /> Incorrect: <br/>
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +