Void Elements

Description

There are some elements that must be expressed using a single tag. These are known as void elements.

One such element is hr.

hr is a grouping element and is used to denote a paragraph-level break in the content.

Example

You can use void elements in one of two ways-the first is to specify only a start tag as shown in the following code.


I like HTML.
<hr>
I like CSS.

The browser knows that hr is a void element and therefore doesn't expect to see a closing tag.

You can make the element consistent with empty elements, as shown in the following code.


I like HTML.
<hr/>
I like CSS.





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed