UNDERSTANDING HTML TAGS AND ELEMENTS

Phavorfavor
2 min readOct 5, 2020

--

HTML Tags

HTML Tags are used to add content in html, like text, headings, table, list links etc. Tags along with attributes are core components of HTML. The latest version of HTML, i.e HTML5 includes 142 tags. View HTML Tags List.

HTML tags are used to build webpage structure, like p, h1, h2, h3, address, b, i, etc. Tags can have attributes to add extra information.

tutorial.techaltum.com

HTML Element

An HTML Tag with attributes and content is called HTML Element. Element include start tag, end tag, attributes and content inside.

Basically all HTML Elements are build using html tags.

https://twitter.com/WebDesignMash

Basic Elements

The basic elements of an HTML page are:

  • A text header, denoted using the <h1>, <h2>, <h3>, <h4>, <h5>, <h6> tags.
  • A paragraph, denoted using the <p> tag.
  • A horizontal ruler, denoted using the <hr> tag.
  • A link, denoted using the <a> (anchor) tag.
  • A list, denoted using the <ul> (unordered list), <ol> (ordered list) and <li> (list element) tags.
  • An image, denoted using the <img> tag
  • A divider, denoted using the <div> tag
  • A text span, denoted using the <span> tag

The next few pages will give an overview of these basic HTML elements.

Each element can also have attributes — each element has a different set of attributes relevant to the element. There are a few global elements, the most common of them are:

https://www.linkedin.com/in/avimalhotra
  • id - Denotes the unique ID of an element in a page. Used for locating elements by using links, JavaScript, and more.
  • class - Denotes the CSS class of an element. Explained in the CSS Basics tutorial.
  • style - Denotes the CSS styles to apply to an element. Explained in the CSS Basics tutorial.
  • data-x attributes - A general prefix for attributes that store raw information for programmatic purposes. Explained in detailed in the Data Attributes section.

--

--