Different types of Tags and their uses

AJ TECH BLOG
1

 Hello Guys.. 

In this article we discuss about types of tags used in HTML.. And we discuss when and where to use these different in our code.. 

There are three types of HTML tags are available.. They are 

1. Container Tags 

2. Non-Container Tags

3. Special Entities 


1. Container Tags:- The Tags which having both open and closing Tags those are called Container Tags.. 

Ex:-

<html> </html> 

In this tags we are writing HTML tag has both open and closing tags.. 

We are writing code inside of this tag.. 

<head></head>

<body> </body>

<title> </title>

<h1> </h1> 

These are all are belongs to container tags..

 

2. Non-Container Tags:- The tags which are having only open tag is called Non-container tag.. 

Example:-

<br> This is a tag which does not having closing tag.. This tag is used to break line.. All details about different tags will be discussed in below..

<hr> etc..

Note:- In the HTML code spaces are not accepted by the browser.. How much space we are mentioned in the HTML code those empty spaces are not accepted by the browser.. Other than single spaces in the sentences If we need any spaces we have mention these types of tags for giving spaces. 



3. Special Entities:- These are not tags but these are used as tags.. Sometimes we want to add coding related entities like <(less than symbol) or > symbol etc.. we need to display in articles but browser can read these as tags and they cannot be displayed in browser..to display these type of symbols we use Special Entities. These are starting with & symbol and end with ;(semicolon). 

Example:- 

&nbsp; used for character space (single space).

&gt; used for > symbol.


There are many Pre-Defined Tags  used in html.

But we are used Some important tags in HTML.. with the help of CSS we will be able to do the designs but without CSS some tags are giving the best results 


Lets check those tags and how they are working


<!DOCTYPE html> :- This is not a tag but this is used to define the version of the html page to browser 

By writing this line browser understand that the file or page belongs to HTML 5 version. 


<html> </html> :- This tag is used to define the page starting and ending of the html file. 


<head> :- This tag is not used for display content in browser. This is used to give content to the browser. By using this data displayed in the browser will effected. It is used to give css content javascript content in browser and also meta content about the page also placed here. Which is used to give Page description and reloading time etc. are given by using meta tag.. We able to do A detailed article regarding Meta tag.


<title> :- This tag is used to give the title to browser and the title will displayed in tab of that page. This tag is used only in head tag only. 

Bold tag :- This tag is useful for Give the bold text .. This tag contains both opening and closing tags 

Ex:

<bold> </bold> 


br :- We already know that spaces are not considered by the browser in html file. If we want to move cursor to next line in the browser we are using br(break) tag.. This is a Non-Container tag There is no end tag for this tag. 

Ex:-

<br />


hr:- This tag is used to give the horizontal line. hr abbrivates Horizontal Ruler this gives a horizontal line. This tag has also Non-Container Tag which means there is no closing tag.

Ex:- 

<hr/>


&nbsp; :- This is a special Entity. we are already discussed about this in special entity definition time. By using this we are able to give Character space Means single space in the browser.. 


&emsp; :- This is also a special entity. by using this entity we are display 4 character spaces in the browser. 


&ensp; :- This entity is used to display 2 character spaces for in browser.


&gt; :- This is used to display greater than symbol(>) in browser. 


&lt; :- This is used to display less than symbol(<) in browser. 


&amp; :- this is used to display & symbol in browser. 


&quote; :- This is used to give Double quotes in browser (""). 


&apos; :- This is used to display single quotes in browser ('').


There are many special entities are available in HTML. Further articles  we are discussing about different entities also.. 

This image contains all above special entities are used 


This is the basic code used above image

=========================================

<html>

<body bgcolor="green">

<h1> ensp entity .. &ensp; .. used here</h1> 

<h1> emsp entity ..&emsp; .. used here</h1> 

<h1> &lt; lt entity</h1> 

<h1> &gt; gt entity</h1>

<h1> &quot; quot entity</h1> 

<h1> &apos; apos entity</h1>

<h1> &amp; amp entity</h1>

</body>

</html>

=========================================

These are some main HTML Container, Non-container and special entities regularly used in HTML.. 


Further articles we are able to discuss some more tags used in html.. 

And also next articles we are discuss about What is attribute and different attributes in html tags.. 


If you like content please give a comment about article and share to your friends who want to learn html, css, javascript as well as some programming languages.. Programming languages will started soon.. 


Thank you for visiting

Tags

Post a Comment

1Comments

  1. If you like our content please share to your friends .. And also mention your option on article

    ReplyDelete
Post a Comment