HTML Elements

In this HTML tutorial, you will learn all about the Elements in HTML. We will also discuss the most commonly used attributes in HTML.

What is meant by HTML Elements?

An HTML element is a standalone component of an HTML document. It represents semantics or meaning. The title element, for example, represents the document's title. The majority of HTML components have a start tag (or opening tag) and an end tag (or closing tag), with content in between. Elements can also have attributes that determine their extra characteristics.

HTML - Elements

What is the difference between the HTML Tags and HTML Elements?

An HTML element is technically the collection of a start tag, its attributes, an end tag, and everything in between. An HTML tag (either opening or closing) is used to denote the beginning or end of an element. In common use, however, the phrases HTML element and HTML tag are identical, i.e., a tag is an element is a tag. For the sake of clarity, the terms "tag" and "element" are used equally on this website to signify the same thing — as it will specify something on your web page.

Case Insensitivity in HTML Tags and Attributes

Tag and attribute names in HTML are not case-sensitive (but most attribute values are case-sensitive). It refers to the tag <P>, and the tag <p> in HTML specifies the same thing, which is a paragraph. However, in XHTML, they are case-sensitive, and the tag <P> differs from the tag <p>.

What all are the Block-level and Inline HTML elements?

In HTML, all components are separated into two groups for the purpose of default display and styling:

  • Block-level element
  • Inline element

Block-level element

  • These are the components that structure the major portion of a web page by separating it into cohesive sections.
  • A block-level element always begins with a new line and occupies the whole width of the web page, from left to right.
  • These elements can include both block-level and inline elements.

The most commonly used block-level elements are <address>, <article>, <aside>, <blockquote>, <canvas>, <dd>, <div>, <dl>, <dt>, <fieldset>, <figcaption>, <figure>, <footer>, <form>, <h1>-<h6>, <header>, <hr>, <li>, <main>, <nav>, <noscript>, <ol>, <output>, <p>, <pre>, <section>, <table>, <tfoot>, <ul> and <video>.

Inline elements

  • Inline elements are those that distinguish a section of text and provide it with a specific function.
  • These items do not begin with a new line and take the width that is required.
  • Inline elements are usually used in combination with other components.

The most commonly used inline elements are <a>, <abbr>, <acronym>, <b>, <bdo>, <big>, <br>, <button>, <cite>, <code>, <dfn>, <em>, <i>, <img>, <input>, <kbd>, <label>, <map>, <object>, <q>, <samp>, <script>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <textarea>, <time>, and <var>.