12 May 2023

HTML Tags & Element

tags
elements
html

T
Written by

thatonevikash

Tags and Element

In HTML every thing starts and ends with Tags 😃

<body>
  <h1>Hello World!</h1>
</body>

In the above block <h1> is a typography tag.

Which represents a heading text with most precedence.

In HTML, there are 6 typography headings with sequential precendence as <h1> → <h2> → <h3> → <h4> → <h5> → <h6>

<h1> has the most precedence value and <h6> has the least precedence value.

Tags

As earlier I told that — "In HTML every thing starts and ends with Tags"

Alike <head> is a tag, <body> is a tag, <h1> is also a tag.

ā„¹ļøNote


HTML is all about dealing with various tags to build layout of any website.

A tag can only be written using <tag> angle brackets.

Elements

You may have noticed that there are pairs of tags as

<body>
  <h1>Hello World!</h1>
</body>

<h1> and </h1> are the pair of opening and closing tags. Which contains some text value.

Collectively, they are known as Element. One element = opening tag + content + closing tag

ā„¹ļøNote


An element may or may not be pair of tags.

<h1>Hello World!</h1>

Is an element with pair of tags

<img src="example.png" />

Is a self-closing tag.

Finally — "An element is nothing just a meaningful tag." šŸ¤“

Written with šŸ’– by thatonevikash!