Write about Different Tags available in HTML?


In HTML the document tags are classified into two types.

  • Block level tags
  • Text level tags
Block level tag:

Block level tag means which are applied to block of text (or) group of text. the text may be single line (or) collection of multiple lines like paragraphs tag. The block level tags are as follows. 

            1) Header tag ()

            2) Paragraph tag ()

            3) Comment tag.

1.Header tag: It is used for providing heading to our web page. A heading is text generally that appears differently with other parts of web page information. By default other parts of web page information is smaller. Headings are used to display line of text with larger font size and in bold phase.

In html 6 different tags are there for headings. Each header tag displays heading in different levels. A first level header tag < h1 > displays heading with large size and sixth level header tag < h6 > displays the heading with least size. Generally any level header tag size is larger than the normal text.


Syntax:  < h1 > Heading</h1>


 Program:

       < html >
            < head >
                   < title > heading tags < /title >
            < /head>
            < body >
                   < h1 > III Bsc </h1>
                   < h2 align = “ right “ > SASI</h2>
                   < h3 > DEGREE </h3>
                   < h4 > COLLEGE</h4>
                   < h5VELIVENNU </h5>
                   < h6 > UNDRAJAVARM MANDAL</h6>
                   DEGREE Students
            < /body >
            < /html >

Align: It is used to position the heading of web page at specified position.



Syntax: h1 align = “Right/left/centre/justify” > text >.

Tag Attributes : Tags can have attributes.

® Attributes provide more information about tags.

® Attributes carry additional features of tags.

® Attribute is nothing but a name, where some data is stored.

® Attribute always comes with name and value pair.

® Attribute values are written in quotations either single (or) double quotations.

® Attribute pair is always specified in beginning tag of html element. we can place unlimited     number of attribute in same element.

Horizontal line tag:It draws a line on the web page where we want. it is represented by “ < hr >”. The < hr &gt tag does not require an end tag.

Attributes of hr tag:

Width: This attribute provide width of horizontal line.

Size: This indicates thickness of horizontal line.

Colour : This attribute provides colour for the horizontal line.

Syntax:<hr size="n" width=" size" align="r/l/c" colour="colour name">
.

2.Paragraph tag: A paragraph tag is represented by < p > ---------< /p>
. This is used to divided the content of web = page into multiple paragraphs. Generally any number of lines are placed in between tag pair is displayed as single paragraph. If header tag is used to separate from rest of other line remaining content become a single paragraph. we need information in web page appears as multiple paragraph in such a case paragraph tag should be used.

Attributes of paragraph tag: It supports one attribute called ‘Align’ display paragraph in some alignment.

Syntax: < p align = “ R/C/T/J”>
                 - - - - - - - - - - - - - -
                 - - - - - - - - - - -< /p>

 Program:

            < html >
                 < head >
                        < title > paragraph tag< /title >

                  < /head >
                  < body >
                     < P > HTML was introduced by JIM BERNERS LEE in the year 1980.< /p>

                    < P align = “Right” > HTML is not a programming language. It is a web                                                  designing language< /p>

                 < /body >

            < /html >


bgcolour: It changes background colour of web page. there are two ways to set the colour.

 One is mentioning rgv code (# rrggbb) in this six hexa decimal number represents the colour.

Eg: < body bgcolour = “00ff00” >.

second is mentioning the colour name.

Eg:. < body bgcolour = “ white” >.

text attribute: It sets text colour of web page of in rgb code (or) colour name.

Eg: < body bgcolour = “ Black” text = “pink”>.

background attribute: It represent the URL of image file that has to be set as background of web page.

Eg:.< body  background="c:\pics\1234.jpg">

If the image and the html document which the image is used is placed in the same directory then no need to give absolute path of the image just give relative path of the image.

< pre > tag: HTML ignores white spaces. if any tabs are in the paragraph then browser will change it into single space. < pre > tag gives output as it is written in notepad.

Syntax:  < pre > text < /pre >

       Eg:  < pre >
                          SASI 
                                    DEGREE
                                                COLLEGE < /Pre>.

 Text level tags: The text on the HTML page can be altered in a no.of ways. These tags are applied to a single character (or) simple text. The following are different text level tags.

  • < b >                   
  • < Sup >
  • < I >                     
  • < Small >
  • < U >                   
  • < big >
  • < Sub >                
  • < Centre >
  • < Blink >             
  • < Strong >

< b > tag: This is also called as ‘bold tag’. This tag indicates that a character (or) text appears in bold phase.

Syntax : < b > text/character< /b >


Eg: < b > Degree College < /b >

I > tag: This is also called Italic tag. This tag is used to display the text in italic phase.

Syntax : < I > text /character < / I >

Eg:  < I > Degree College < / I >


< U > tag:This is also called as ‘underline tag’. This tag is used to display the text with underline below it.

Syntax: < U > text/charater < /u >

Eg:  < u > Degree College < /u >

< Sub > tag (subscript tag): It is used to display the text in subscript notation. using < sub > tag we  can display chemical formulas and mathematical equations.

Syntax: < Sub > content < /Sub >


Eg: H < Sub > 2 < /Sub > O

 o/p : H2O

< sup > tag (superscript tag): It displays the text in super script notation. It is also used to display the mathematical equations.

Syntax:  < sup > content < /sup >

Eg: 2 < sup > n< /sup >


< small > tag: It displays the text in small size. It contains both begin and end tags. It supports only one inner tag for decreasing the size of the text in internet explorer.

Eg: < small > < small > Degree </ small > < /small >


< big > tag: It is useful to increase the size of the text than the font size. it contains both begin and end tags ‘big’ supports only three inner tags for increasing size of the text in internet explorer.

Eg: < big > < big > < big > < big > Degree < /big > < /big > < /big > < /big >
.
< centre > tag: It displays the text at the centre of the page. when centre tag is used no need to use < br > tag

Syntax: < centre >text< /centre >

Eg: < centre >family< /centre >

< strong > tag:  It is used for bold phased text.

Syntax: < strong> text< /strong>


Eg: < strong>Students< /strong>

< blink > tag: It is used to present blinking  text. But it doesn’t work on internet explorer.

All the above tags are used for changing the appearance of text in the web page.

 Propgram:

            < html >
                  < head >
                        < title > HTML tags < /title >
                  < /head >
                  < body > bgcolour = “Red” >
                  < h1 > HTML tags < /h1 >
                  < p > we can use < b > simple tags to < I > change the appearance of                      < strong > text with in < u > web page < /u> even super < sup >                        script and sub script are supported < br> positive numbers are > o

                < /p >
               < /body >
         < /html >
           





Related

Web Technology 3119997987169332212

Post a Comment

emo-but-icon

item