Introduction to html tags

Introduction to html tags

HTML (Hypertext Markup Language) is the standard programming language used to create content displayed on a web page. It is a fundamental building block on which website designs are developed on the internet.

In this article, we will discuss several important HTML tags and how you can use those HTML tags. By the end of this guide, you will be able to confidently write HTML code and utilize them in building your websites.

HTML Tags and Examples

HTML tags usually begin with a greater than sign, and then end with a less than sign () when opening them, but to close them off, a forward slash is added before the less than sign (). Some basic examples of HTML tags include;

  1. The <html> tag

  2. The header <head> tag

  3. The <body> tag

  4. The <h1> to <h6> tags

  5. The paragraph <p> tag

  6. The <div> tag

  7. The image <img> tag

  8. The hyperlink <a> tag

  9. The list <ul> and <ol> tags

  10. The <iframe> tag

Most HTML tags are paired this way as this indicates where the particular tag begins and ends.

Using HTML Tags

In this next section, we will discuss the previously listed 10 HTML tags in detail. You will become familiar with the syntax and explore examples of using these tags.

The Open and Close Tags

The HTML tag is the first tag used as this indicates that the entire page is encapsulated in HTML. The following declares the HTML version is HTML5

  <!-- Browser Content-->

The Header Tags

The Head tag indicates the header of the web page. Content meant to be in the header is written within this tag.

  <title>Hello World</title>

The Body Tags

The Body tag indicates the main body of the web page. Most of the content on the web page, be it paragraphs, links, and other media, is encapsulated within this tag. The body makes up for most of the content on the web page.

 <h1>The Main Webpage</h1> 
 <p>This is the main content.</p> 

The Heading Tags

The heading tags define the font size of the headers. It usually points out which part of the header is more important than the other. <h1> indicates the biggest or most important while <h6> indicates the smallest or least important.

<h1>Main Header</h1>

The Paragraph Tag

The <p> tag is used to indicate the start of a new paragraph. Be careful not to forget to close off the tag </p> to mark the end of that particular paragraph.

<p>Lorem ipsum dolor paragraph </p>

The Div Tag

The <div> tag is used for secluding a portion of the content to apply styling. Different design functions like ‘style’ and ‘padding’ can be implemented in the <div> tag.

<div style="border: 3px solid #000; padding: 20px;">
  <p>10x Frontend Developer</p>

As you can see above, the ‘style’ and ‘padding’ functions are only applied to the paragraph “10x Frontend Developer ’’.

The Image Tag

The <img> tags are used when inserting images into the web page. Images in your device storage can easily be inserted into the web page by using this tag along with the ‘alt’ function to describe the image.

<img src="image.jpg"
 alt="A Cat">

The Hyperlink tag is used when inserting links to external resources or websites. When a user clicks on a text embedded in this tag, it automatically redirects them to an external website.

<a href=""> Available at</a>

The List Tags

As the name implies, the list tags are used to create lists on the web page. <ul> creates an “Unordered List” while <ol> creates an “Ordered List”.

  <li>Micheal Scofield</li>
  <li>Barry Allen</li>
  <li>Frank Ocean</li>


The Iframe Tag

The <iframe> tag is used when inserting external files like thumbnails into your web page. This is essential for adding external media to your web page.

<iframe src=""
 width="400" height="200"></iframe>

Implementing HTML Tags

The above tags are important parts of HTML and can not be overlooked. It is important for any web developer to master or at least have an idea of the tags, their uses and how to adequately implement them to create a complete web page. If a tag is not properly implemented, like not being closed off properly, the tag is rendered invalid and hence can not affect the web page.

<!DOCTYPE html>

  <h1>Hello World</h1>

  <p> This is my first webpage. These are my favorite musicians.
    <li>Brent Faiyaz</li>
    <li>Burna Boy</li>
  <div style="border: 3px solid #222; padding: 20px;">
    Check me out at <a href="https;//"></a>


The image below shows the results of the HTML code above:


As you can see, all the tags here are promptly closed off, and all the content on the web page is encapsulated in the html tag.


You have learned about the basic HTML tags and their functions, but of course, there are many more tags with their different uses, some don't even need to be closed off. To learn more about these tags, log on to for more examples.