What are some basic tags in HTML?

A tag represents the root of an HTML document. They are used to delimit the start and end of elements in the markup.

HTML tags are like keywords that define how a web browser will format and display the content. With the help of tags, a web browser can distinguish between an HTML program and simple content. HTML tags contain three main parts: an opening tag, content, and closing tag. But some HTML tags are unclosed tags.

An HTML file must have some essential tags so that the web browser can differentiate between simple text and HTML text. You can use as many tags as you want as per your code requirement.

All HTML tags must be enclosed within < > these brackets.
Every tag in HTML performs different tasks.
If you have used an open tag , then you must use a close tag (except for some tags)

Some of the most basic HTML tags and their syntax are as follows:


| Comment tag | <! - - comment tag - - > |

The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers.
| Doctype | <!Doctype> |

All HTML documents must start with a <!DOCTYPE> declaration.

The declaration is not an HTML tag. It is an "information" to the browser about what document type to expect.

| HTML tag | <html>   </html> |

The <html> tag represents the root of an HTML document.

The <html> tag is the container for all other HTML elements (except for the <!DOCTYPE> tag).
| Head tag | <head>    </head> |

The <head> element is a container for metadata (data about data) and is placed between the <html> tag and the <body> tag.

Metadata is data about the HTML document. Metadata is not displayed.
| Title tag | <title>     </title> |

The <title> tag defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab.

The <title> tag is required in HTML documents!
| Body tag | <body>    </body> |

The <body> tag defines the document's body.

The <body> element contains all the contents of an HTML document, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
| Horizontal Line tag | <hr>     </hr> |

The <hr> tag defines a thematic break in an HTML page (e.g. a shift of topic).

The <hr> element is most often displayed as a horizontal rule that is used to separate content (or define a change) in an HTML page.
| Break Tag | <br>    </br> |

The <br> tag inserts a single line break.

The <br> tag is useful for writing addresses or poems.

The <br> tag is an empty tag which means that it has no end tag.

Thanks for sharing this amazing list of HTML tags. I just started my career as a MEAN developer and like to gather programming knowledge as much as possible.