Skip to content

What are HTML Elements?

When you purchase through referral links on our site, we earn a commission. Read our Advertiser Disclosure

An HTML element is an individual component of an HTML document. HTML documents are composed of a tree of HTML elements and other nodes, such as text nodes. Each element can have attributes specified. Elements can also have content, including other elements and text. HTML elements represent semantics, or meaning. For example, the title element represents the title of the document.

In the HTML syntax, most elements are written with a start tag and an end tag, with the content in between. Tags are composed of the name of the element, surrounded by angle brackets. An end tag also has a slash after the opening angle bracket, to distinguish it from the start tag. For example, a paragraph, which is represented by the p element, would be written as

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, …</p>

However, not all of these elements require the end tag, or even the start tag, to be present. Some elements, the so-called void elements don’t have an end tag. A typical example is the br element, which represents a significant line break, such as in a poem or an address. For example, the address of the dentist in Finding Nemo would be written as

<p>P. Sherman<br>42 Wallaby Way<br>Sydney</p>

Attributes are specified on the start tag. For example, the abbr element, which represents an abbreviation, expects a title attribute with its expansion. This would be written as

<abbr title="Hyper Text Markup Language">HTML</abbr>

Share this post on social

About us

We are a financial blog that offers expert advise for wealth management.

Topics

The content on this website is for educational and informational purposes only and should not be construed as professional financial advice. We are not a financial institution and does not provide any financial products or services. We strive to provide up-to-date information but make no warranties regarding the accuracy of our information.