Tags in HTML - II

Tags in HTML- II | Web Development

In the previous article, we have learned some of the basic HTML tags (like heading and paragraph tag) which will be the most used tags in websites.

let’s see some more tags that can help us structure our website more conveniently (easily) and beautifully.

  • Anchor tag :

An anchor tag is a hyperlink used to redirect (link) one page of the website to the other.

The most important attribute of the Anchor tag is the href attribute, which indicates the destination of the link provided in the attribute.

By default, the links will appear as follows :

  • An underlined and blue link is an unvisited link.
  • An underlined and purple link is the visited link.
  • An underlined and red link is an active link.
<a href="https://developersdome.com">Visit DevelopersDome.com!</a>

Output :

Visit DevelopersDome.com!

  • Division tag :

The division tag creates a section in an HTML document.

It is used as a container for other HTML tags.

<!DOCTYPE html>
<html>
<head>
<style>
div { /* you can skip this section for now as we will learn the CSS part in upcoming articles */
  border: 5px outset red;
  background-color: lightblue;    
  text-align: center;
}
</style>
</head>
<body>

<h1>The division element</h1>

<div>
  <h2>This is a heading in a division element</h2>
  <p>This is some text in a division element.</p>
</div>

<p>This is some text outside the division element.</p>

</body>
</html>

Output :

  • Span tag :

The span tag is an inline container that is used to mark up a small section of text or an HTML document.

It is much like a Division tag, but the Division tag is a block element whereas the Span tag is an inline element.

<!DOCTYPE html>
<html>
<head>
<style>
body{
background-color: #99ccff;
}
</style>
</head>
<body>

<h1>The span element</h1>

<p> Our logo has <span style="color:#007A4D;font-weight:bold">green</span> background and  <span style="color:white;font-weight:bold">white</span> text in it.</p>

</body>
</html>

Output :

Hope this article will guide you to recognize some more HTML tags you needed and still if you have any problems or queries regarding this, post them in the comments section and we will be glad to assist you.

This Post Has 2 Comments

Leave a Reply