HTML Tags

Earlier, we had studied about the html language (intro part), Now we are going to learn about the different html tags available in html.

  •   <head> tag

The head tag is used to define the document header. The head tag contains the information about the document including titles, scripts, other html tags. Head tag is also called container tag. It contains title tag. To add head tag we enter it between the html tags and head tag is used inside html tags.

1.      <head> tag is placed between  <html> tag and  <body> tag.

2 .     It is a first element inside an html element.

3.      It starts with the after starting html tag and ends before the starting body tag.

4.      In the head tag we can use title,  links,  styles,  script tag.

Example :

<!DOCTYPE html>

<html>

<head>

<title>My First Web Page </title>

</head>

<body>

<h1>My First Heading </h1>

<p>My First Paragraph</p>

</body>

</html>

  • <TITLE> TAG

The title elements(tag) contains the title of the document and it help us in identifies the content in a global context.the title is displayed at the top of the browser where we run the document which was  written in notepad. A  title is also used to identify your page for search engines.

Note: The title should be able to convey the purpose of your web page . generally we should the keep the title atleast 64 characters or fewer.

List of HTML Tags

  • BODY TAG

The second and largest part of any html document is the body this tag contain the content of any document (displayed within the text area of the browser window).the body tags defines the document’s body.it contain all the contents like images,text,list,tables,htperlink etc.

Now , we gonna see some attributes of the body tag are :

bgcolor:  this attribute is used to give background color of the page.

 

Syntax:

<html>

<head>

<body bgcolor=”red”></body>

  • HTML heading tag <h1> to <h6> 
  1.  Heading tag defines from <h1> tag to <h6> tag.
  2. <h1> tag  is most important heading.
  3. <h6> tag is least important heading.
  4. Heading tag starts with <h1> tag and ends with </h1> tag.
  5. it defines within <body> tag

Example:-

<!DOCTYPE html>

<html>

<body>

<h1>My first heading</h1>

<h2>My second heading</h2>

<h3>My third heading</h3>

<h4>My fourth heading</h4>

<h5>My fifth heading</h5>

<h6>My sixth heading</h5>

</body>

</html>

  • HTML Paragraph Tag <p>

1. It used to write the paragraph in web page.

2. It uses within body tag.

3. It starts with the starting tag <p> and ending with</p>

 

 

html tags
p tag

   Example:-

<!DOCTYPE html>

<html>

<body>

<h1> My First Heading</h1>

<p> My First paragraph</p>

</body>

</html>

More html tags examples available at Mozila html elements page.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>