Page Nav

HIDE

Grid

GRID_STYLE

Classic Header

{fbt_classic_header}

Latest:

latest

HTML tags, HTML syntax

Introduction to html tags and html syntax HTML tags and HTML syntax are some signs and words which are used for representing web page conte...

HTML tags and HTML syntax

Introduction to html tags and html syntax

HTML tags and HTML syntax are some signs and words which are used for representing web page contents to user browser. This also known as Markup tag.

HTML keywords are bound in between angle bracket <(Less than sign) and the > (Greater than sign).
For example in html there is a tag called HEAD tag. We have write that tag like this
<head>. Another tag is TITLE tag. We write like this <title>.


Some rules for writing html tags

  • Starts with “<” (Less than sign)
  • Than we have to write tag name.
  • At last we have to complete that tag by “>” (Greater than sign)


Example:<br>, <i>, <p> etc.


We have to use many types of tags in html.
 Most of the tags have two parts. Few tags have only a single part. Two parts are,

  1. Opening tag
  2. Closing tag


01. Opening tag


By the opening tag the text starts. In this type of tag have to write tag like this

  • At first “< “(Less than sign)
  • Now have to write the tag name.
  • At last”> “(Greater than sign).


Example: <body>, <b>, <i>

02. Closing tag


By the closing tag text is closed. In this type of tag have to write tag like this

  • At first “<” (Less than sign)
  • Have to give “/” (Front slash)
  • Now have to write the tag name.
  • At last”>” (Greater than sign).


Example: </body>, </b>, </i>

HTML tag basic syntax example

HTML tag basic syntax example



Types of HTML tag


  1. Container tag
  2. Empty tag

01. Container tag

Those tags which contains content and it has opening and closing both tag those are called container tag.

Example:<p>, <body>, <head>

02. Empty tag

These type of tag has opening tag but has no closing tag. Also it doesn't contains any content. These are called empty tag.

Example:<br>, <hr>

We have to follow some rules on writing html tags.

  • We have to write the correct spelling of the tag, otherwise we will not get expected correct outputs.
  • Now the tags are written by using small letters.
  • If we are using container tag we have to ensure that we have closed that container tag.

Basic syntax of html page 

<!DOCTYPE>
<html>
<head>
<title>This is the title</title>
</head>
<body>
Here is the body.Contains texts.
</body>
</html>

If we write these in Notepad we will get output like this.

A html page creating


After saving this html file we have to open this with a browser. And we will get output result like as given below.


HTML page output




No comments