HTML (Hypertext markup language) – In this, we will know what is HTML tag is and what is its importance in creating an HTML web page.
Understanding HTML tags is not very difficult. With continuous practice, you can become a master of HTML tags in no time. In this post, we will know what HTML tags are and will also tell you examples of some basic HTML tags. Due to which it will be very easy for you to understand HTML tags. So without wasting any time let’s start to Learn Html – what is HTML tag.
In this article, we are going to talk about all these topics.
- What is HTML Tag?
- What is the function of HTML Tag
- Some Basic Html Tags and their Examples
What is HTML Tag?
HTML tags are a type of code, which is represented by writing their name between two singular brackets (<>). Each tag is identified and has a different function. These tags are use from making the top part (head) of a web page to making the lower (footer) and middle (content area) parts. These tags are divide into two parts respectively.
- Paired Tags
- Unpaired Tags.
These tags are pair. They have both opening and closing tags. The opening tag is also called the starting tag, which is defined with <head>. The same closing tag is defined by putting a slash (/) inside angular brackets ( </head> ). Example-
<Head> Html Tag </Head>
The head tag is shown in the above example. Which is used to make the head part (upper part) of the web page. Now since this is a paired tag, this ( <Head> ) is its opening tag and ( </Head> ) its closing tag. Almost all the important tags are paired.
Paired Tags Example
- Html tag – <html> </html>
- Title tag – <Titel> </Titel>
- Body tag – <Body> </Body>
- Heading tag – <h1> </h1>
- Paragraph tag – <p> </p>
- Bold tag – <b> </b>
- Italic tag – <i> </i>
- Underline tag – <u> </u>
These tags are not paired but single, they do not have any opening and closing tags. The use of such tags is very less when creating web pages. Example- <br>
In the above example, this is a Line Break tag. Which is used while writing a paragraph, ending one line, and writing another line. Now since it is an unpaired tag, hence it does not have an opening and closing tag.
- Image tag – <image>
- Horizontal Line tag – <hr>
What is the function of HTML Tag?
When Tim-Berners-Lee started the World wide web for document sharing. Then he made his first software ENQUIRE. This software was in very simple language. Its job was to send a text from one computer to another. Due to the demand for new technology, Lee started browser and server software in 1990, specifying the Html language.
- While creating the browser and server software, Lee created some special codes to make them work.
- With the help of these codes, you can give special commands and explain your webpage to the browser.
- Today we call these codes Html Tags. These tags were written before web pages were created.
- The browser and software server already understand the commands of all these tags.
For example, while creating a web page, when we write the head tag (<head>) in the HTML document and run it in the browser, then the browser understands the command of that tag and shows it on the output web page.
Now because each HTML element (tags) has its own command for the browser. With the help of which we can create the structure of a web page. Basically, in an HTML document, these tags are use to create the structure of the web page.
Some Basic Html Tags and their Examples
Basic Paired Html Tags:
- DOCTYPE Tag – <!DOCTYPE>
- Html Tag – <html></html>
This tag is the main tag of HTML. Which defines an HTML document. Creating an HTML document is started with this tag. All the rest of the HTML elements are written in between this tag.
- Head Tag – <head></head>
The header area of the web page is created by this tag. This tag provides essential information about a web page. <title>, <style>, <script>, <link>, <meta> all these tags are written inside the head tag.
- Body Tag – <Body></Body>
This tag is use to create the content area of the web page. This is a very important tag. Body tag can be use only once in an HTML document.
- Title Tag – <title></title>
The title tag is use to give the title of any web page. It is written inside the head tag. With the help of the title tag, the browser is able to know what the web page is about.
- Heading Tag – <h1></h1>
This tag is use to write the heading of the document. Heading tags start from h1 to h6 respectively.
- Paragraph Tag – <p></p>
This tag is use to write paragraphs. You can use any number of paragraphs in your HTML document by using this Paragraph Tag.
- Bold Tag – <B></B>
This Bold tag is use to bold or makes an important text bold. Any number of bold tags can be use in an HTML document.
- Italic Tag – <i></i>
The italic tag is use to italicize a text. This tag can be use multiple times in an HTML document.
- Underline Tag – <u></u>
Underline tag is use to underline the text. Using this tag draws a deep line below the text.
Also learn: How to Earn Money from Google
Basic Unpaired Html Tags:
- Line Break Tag – <br>
While writing a paragraph in an HTML document, Line Break Tag is use to end a line and start the next line. With the help of this tag, the line of the paragraph is not straight but alternately. Due to which the size of a web page remains under control.
- Image Tags – <img>
The image tag is use to add an image to the HTML document. src, alt, width, height, and style are all attributes of the image tag. With the help of which we can get the URL, width, height, etc. of that image. Can give everything.
- Horizontal Line Tag – <hr>
This tag use to specify the thematic breaks in the paragraph. If you shift from your topic while writing a paragraph, then this tag draws a line between those two topics. Due to which a gap comes between them.
Conclusion– Today we have learned in this part what HTML tags are? and how they work. To ask all your questions, submit your comment in the comment box below.