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.

Html Basic Introduction

Basic Introduction on Html

Html basically is a markup language which is used to create front end structure of an website, front-end refers to the data which we see on the web.

Html stands for Hyper Text Markup Language. Html is not an programming language rather it is an markup language (which uses tags to define elements within a document). html is a case insensitive language that means we can use both capital case and smaller case for writing tags. Html files have an extension .html or .htm.

Html is developed by world wide web consortium. The current version of html that we are now using is html5.

  • HTML Versions

Since the early days of the web, there have been many versions of HTML:

Version Year
HTML 1991
HTML 2.0 1995
HTML 3.2 1997
HTML 4.01 1999
XHTML 2000
HTML5 2014
  • Prerequisite

no need of any programming background basic code are written in form of tags  which can easing understand by anyone whose ever having basic knowledge regarding alphabets and symbols.

it need only browser to run the code that was written in any text editor like notepad.

html support various browser such as mozilla firefox,google chrome, safari, opera mini, internet explorer etc.

  • Where to write?

for writting the code first of all we have to open a text editor like notepad or notepad++. after the writting code we have to save code  with exetention .html and  we can also reopen the html file with notepad to make any edtion

  • Basic structure of Html is given below

<HTML>

<HEAD> <TITLE> Document Title </TITLE> </HEAD>

<BODY>

This is the Body of the Webpage.

  •   HTML Tags

every tag in html we uses has its own way to show output on the webpage.. so now we will see what are the different tags are avalaible in html :-

The basic tag is heading tag ie  <h1> to <h6> where h1 gives the maximum size of the text while <h6> give the lowest size of the text.

  • COMMENT TAG

this tag is used when we want to  insert a comment on html source code but it not show any change in web browser because this tag is just used to give  information aboat the code. it will help to user when he will edit the source code in future

html basic

These are the some basic tags which are commonly used while designing of webpages :-

html example

  • Advantages of HTML:
  1. First advantage it is widely used   its simply means that html is used all over the world.
  2. Every browser supports HTML language.
  3. Easy to learn and use.
  4. It is by default in every windows so you don’t need to purchase extra software.
  • Disadvantages of HTML:
  1. It can create only static and plain pages so if we need dynamic pages then HTML is not useful.
  2. Need to write lot of code for making simple webpage.
  3. Security features are not good in HTML.
  4. If we need to write long code for making a webpage then it produces some complexity.