Tags of HTML-Basics

1. Body Element <BODY>

Attributes:

i) BGCOLOR : It changes background color

ii) BACKGROUND: It inserts image as background

iii) TEXT : It changes text color

iv) LEFTMARGIN: sets left hand margin

v) TOPMARGIN: sets top margin

vi) LINK: It specifies the colour used for hypertext.

TAGS: i) <BODY BGCOLOR=”color_name” TEXT=”text_color”>

ii) <BODY BACKGROUND=”…. URL….”>

Note: Always close BODY element after completing using the tags.

2. Horizontal Element <HR>

It defines a horizontal line.

Attributes:

i) SIZE : It defines the thickness of line.

ii) COLOR: It defines the color of line.

iii) WIDTH : It defines horizontal width of line.

TAG: i) <HR SIZE=”5″ COLOR=”red” WIDTH=”100%>

3. Heading Element <Hn>

It describes the topic of the section.

TAG:

i) <H1 align=”center”>Hello World</H1>

ii) <H1 align=”center”><font color=”red”>Hello World</font></H1>

Note:  We can declare H1 to H6

4.  Font Element <FONT>

It is used to change the size, typeface and color of font.

Attributes:

i) SIZE : It is used to specify  size of font between 1 to 7.

ii) COLOR: It changes the color of the font.

iii)FACE: It specifies the font name.

TAG: i) <FONT SIZE=”7″ COLOR=”blue” FACE=”Times New Roman”>Hello World</FONT>

Formatting Elements

  • BOLD Element <B>: It causes the text to appear in a bold typeface. Eg: <B>HELLO WORLD</B>
  • ITALIC Element <I>: It causes the text to appear in italics. Eg: <I> HELLO WORLD</I>
  • UNDERLINE Element <U>: It causes the text to appear in underline. Eg: <U>HELLO WORLD</U>
  • SUPERSCRIPT Element <SUP>: It causes the text to appear in upper side from normal baseline.                          Eg: A<SUP>2</SUP>
  • SUBSCRIPT Element <SUB>: It causes the text to appear in lower side from normal baseline.                                Eg :  O <SUB>2</SUB>

5. Paragraph Element <P>

It indicates the start of a paragraph.

TAG: <P ALIGN=”center”>THIS IS A TEST MESSAGE</P>

Note: ALIGN: Center / Left / Right.

6. Line Break Element <BR>

It is an empty element that moves any text following it to the next text.

TAG: <BR>

7. Image Element <IMG>

Adds image to a webpage

Attributes:

i) SRC : Location of image

ii) ALIGN: It controls the alignment of the image. TOP / BOTTOM / LEFT / RIGHT

iii) HEIGHT: It specifies the height of image in pixel.

iv) WIDTH: It specifies the width of image in pixel.

v) ALT: It specifies the alternate text.

vi) BORDER: It specifies the size of the border to the placed around the image.

vii) HSPACE: It indicates the amount of space to the left and right of the margin.

viii) VSPACE: It indicates the amount of space to the top and bottom of the margin.

TAG: i) <IMG SRC=”image_URL” ALT=”image_name” ALIGN=”right” height=”300″ width=”300″ BORDER=”3″>

8. Marquee Element (MARQUEE>

It creates a special region in webpage that displays horizontal scrolling either text or image.

Attributes:

i) BEHAVIOR : alternate, slide, scroll

ii)DIRECTION: left, right, top, down

iii) SCROLLDELAY: It sets an amount of time in millisecond

iv) BGCOLOR: It sets background color for marquee.

TAGS:

i) <MARQUEE>Hello World</MARQUEE>

ii) <MARQUEE BEHAVIOR=”alternate” BGCOLOR=”yellow” SCROLLDELAY=”1000″>HELLO WORLD</MARQUEE>

iii)  <MARQUEE DIRECTION=”top” BGCOLOR=”yellow” SCROLLDELAY=”1000″>HELLO WORLD</MARQUEE>

Note: Do not use BEHAVIOR and DIRECTION attribute in the same TAG

MARQUEE  Element and FONT Element (Change font color in marquee)

<MARQUEE BEHAVIOR=”alternate” BGCOLOR=”yellow” SCROLLDELAY=”1000″><FONT SIZE=”7″ COLOR=”red” FACE=”verdana”>HELLO WORLD</FONT></MARQUEE>

MARQUEE Element and Image Element (Scroll Image)

<MARQUEE><IMG SRC=”image_URL” ALT=”image_name” ALIGN=”right” height=”300″ width=”300″ BORDER=”3″></MARQUEE>

9. Anchor Element (<A HREF>)

It is used to link between the webpages.

TAG: <A HREF=”URL”>TEXT DESCRIBING </A>

It is used to link on same page

TAG:  <A HREF=”#NAME”>TEXT  DESCRIBING</A>   [place to click]

<A NAME=”NAME”>TEXT </A>                                   [after click this part will activate]