In this article, we will discuss the 20+ fundamental HTML tags that you must know. As you all know HTML is very easy to learn, and thus we must understand the uses and meaning of each and every tag we use. We will learn about the following tags:
- THead(Table Header)
- TBody(Table Body)
- TR(Table Row)
- TD(Table Data)
- UL(Unordered List)
- OL(Ordered List)
Top 20 Fundamental HTML Tags You Must Know
Let’s directly jump to the tags without any further delay.
It is the most elementary and basic block of the HTML document. It implies the structure and meaning of the content.
<html>HTML DOCUMENT CONTENTS</html>
Head tag is one of the most crucial tags used in HTML and web designing. This tag contains all the information regarding the website that is not of client interest(metadata, links to external stylesheets and scripts), except the title.
<head> Metadata and other relevant information </head>
The title tag defines the title of the webpage. This title is shown in the title bar of the browser.
<title> The title of your website <title>
The body tag consists of the content of the HTML. All the information that is presented to the client is usually put inside the body tag.
Note: Only a single body tag is preferred in an HTML document.
Div tag represents generic and fundamental vessels to contain the data. It is one of the most used tags in HTML. A div tag is a block-level element, which means that it does not share horizontal space with other elements.
<div> Contents </div>
The vertical equivalent of the div tag is the span tag. A span tag creates a vessel that can hold the data while sharing the horizontal spacing with other elements of the document. And again, just like div, the span tag is also one of the most used tags in HTML.
Note: The span and the div tags are very generic and fundamental in nature, hence overusing these tags should be avoided. Overusing these generic containers is not beneficial for the overall structure of the website. Instead, one should use more semantic tags like section, footer, header, etc.
<span> Contents </span>
The a(anchor) tag is used to attach a link to the contents lying inside this tag. It can have different attributes like target, referrerpolicy, type, etc.
<a href = "External Link"> Contents </a>
This tag inserts a line break in the HTML document. The br tag is an empty tag, meaning it doesn’t need any closing tag. Further, it is also a block-level element. It is often used to separate two different blocks of data.
The section tag is used to represent a section of contents. It is a semantic HTML tag. Semantic elements give more logical meaning to the HTML document and they also prove to be useful for screen readers.
<section> Content </section>
This tag is used to represent the navigation bar of the HTML document. Again, just like the section tag, the nav tag is also one of the semantic elements of HTML. Using nav tags to implement the navigation bar creates a more positive impact on the structure of the website and is also helpful for screen readers.
<nav> Contents </nav>
The footer tag is a semantic tag that adds to the structure of the document. Also, screen readers find it easier to differentiate between a footer created using the footer tag than those developed using the div tag.
<footer> Footer Contents </footer>
The table tag creates a table structure inside which rows and columns can be implemented according to the developer’s needs.
<table> Table Contents....Table Headers and Rows </table>
This tag represents the row that contains the header for all the columns of the table.
<table> <caption>Council budget (in Rs) 2021</caption> <thead> <tr> <th scope="col">Item Name</th> <th scope="col">Cost</th> </tr> </thead> </table>
The tbody tag constitutes the body of the table. It consists of all the rows and the data inside them.
<table> <tbody> <tr> <th scope="row">Cake</th> <td>3,000</td> </tr> <tr> <th scope="row">Grocerries</th> <td>18,000</td> </tr> </tbody> </table>
This particular tag represents a single row inside a table. This row will further contain the data based on the different columns present inside the table.
<tr> <th scope="col">Name</th> <th scope="col">Email</th> <th scope="col">Contact Number</th> </tr>
The td tag represents the data inside a particular column of a table. This is the most fundamental element of a table.
<script> document.getElementById("Malik").content = "Hello There!"; </script>
The img embeds an image on the website. Further, this tag has a lot of attributes that control the alternate text, visibility, dimensions, and the position of the image like: src, width, etc.
<img src = "Url to the image...Either relative or absolute" alt = "Any text describing the image">
The ul tag represents an unordered list. This tag creates the outer structure of the list, and the list can further have the list elements and even other lists nested inside it.
<ul> <li>Malik</li> <li>Car <ul> <li>Welcome</li> <li>Everyone</li> </ul> </li> </ul>
Analogous to the ul tag, the ol tag indicates an ordered list. This list is usually a sorted numerically indicated list whose appearance can be customized according to the needs of the developer.
<ol> <li>Dragon Fruit</li> <li>Mango</li> <li>Banana</li> <li>Apple</li> <li>Kiwi</li> </ol>
The HTML is huge and one can not master it overnight, it consists of a large number of tags and, each tag further has many many attributes inside it. So let’s conclude this article now, in this article we discussed 20+ most fundamental and commonly used HTML tags.
To learn more about HTML and HTML tags you can refer to the following websites: