2. Attributes of Body Tag
• BGCOLOR: is used to change the background color of the web page
• For example
• <Body bgcolor = “green”> OR
• <Body bgcolor = “#1234”>
• BACKGROUND: Is used to insert an image at the background of the web
page.
• For Example
• <Body background = “winter.jpg”> OR
• <Body background = “C:Documents and SettingsAll UsersDocumentsMy
PicturesSample PicturesBlue hills.jpg”>
3. Attributes of Body Tag
• Text: is used to change the color of the text.
• For Example
• <Body text = “Green”>
• For Example
• <BODY bgcolor = “Pink” text = “White”>
4. Headings Tags
• The <Hn> is used to set the different font sizes for
the text.
• Here “H” stands for Heading and n stands for any
number from 1 to 6.
• The value 1 represents the largest and the value 6
represent the smallest heading size.
• The format for an HTML heading tag is
• <Hn> Text to appear in Heading </Hn>
• Important Attribute:
• Align: Specifies the alignment of the heading.
• Possible Values: center, Left and right
6. BOLD Tag
• The Bold <B> … </B> tags are used to make the text bold.
For Example
<HTML>
<BODY>
<B> THIS LINE IS BOLD </B>
</BODY>
</HTML>
7. Italic Tag
• The Italic <I> … </I> tags are used to display the text in Italic style.
For Example
<HTML>
<BODY>
<I> THIS LINE IS WRITEN IN ITALIC STYLE </I>
</BODY>
</HTML>
8. Underline Tag
• The underline <U> … </U> tags are used to underline the given.
For Example
<HTML>
<BODY>
<U> THIS LINE IS UNDERLINE </U>
</BODY>
</HTML>
9. Controlling Font Size and Color
All Text specified within the tags <FONT> and
</FONT> will appear in the font, size and color as
specified as attributes of the tag <FONT>.
The attributes are:
Attributes
FACE Sets the font to the specified font name
SIZE Sets the size of the text.
COLOR Set the color of the text
10.
11. <HTML>
<BODY>
<FONT size = 6 color=“Green”>
THIS LINE IS IN GREEN COLOR
</FONT>
<br>
<FONT size = 5 color=“#cccccc”>
THIS IS ANOTHER WAY TO CHANGE COLOR
</FONT>
</BODY>
</HTML>
12. <HTML>
<BODY>
<FONT face = "arial black">
THIS LINE IS IN GREEN COLOR
</FONT>
<br>
<FONT face = "Arial">
THIS IS ANOTHER WAY TO CHANGE COLOR
</FONT>
</BODY>
</HTML>
13. Center tag
<Center> …….. </Center> tags are used to center
everything found between them
• Text
• List
• Images
• Table or any other page element.
For example
<CENTER> Welcome to RIHE University</CENTER>
14. Paragraph Tag
The Paragraph tag <p> …. </p> is used to insert a blank line and starts a new
paragraph.
Attribute
Align: Specifies the alignment of the paragraph
Possible Values: Center, Left, Right, Justify
For example
<HTML>
<Body>
<P> This is first paragraph </P>
<P> This is second paragraph </P>
</body>
</HTML>
15. <Marquee> Tag
• Is used to scroll the text around the web page.
• Direction: shows from which side the text should scroll.
• For Example:
• <Marquee Direction = “up”> HELLO </Marquee>
• Scrollamount: shows how many spaces the text should
jump.
• For EXAMPLE:
• <Marquee Scrollamount =10> HELLO </Marquee>
• <Marquee direction = “left” scrollamount = 10>
16. Marquee Tag (Cont)
• BEHAVIOR: (Scroll, Alternate, Slide) indicates how the
contents scroll.
• BGCOLOR: sets the background color of the marquee.
• HSPACE: sets the horizontal space to the left and right
of the marquee.
• VSPACE: sets the vertical space at the top and bottom
of the marquee.
• LOOP: sets how many times the marquee should loop.
• WIDTH and HEIGHT set the dimensions of the marquee.
17. Onmouseover and Onmouseout attributes
• In a marquee if you want to stop or start the text the attributes “Onmouseout”
and “Onmouseover” are used.
• The stop() and the start() function is used along with “this.”
• Example
<html>
<body>
<marquee Onmouseout =this.start(); onmouseover=this.stop();>
This is some text in the marquee
</marquee>
</body>
</html>
18. Comments
In HTML, you can make comments about your
code. These are notes to yourself.
They will not be shown in the rendered HTML
But when the HTML code is downloaded, it will
have comments included.
Comments start with <!--
Comments end with -->
Example: <!-- this is a comment -->
22. Assignment
Q.1 Make a web page with Blue Background and White text over it
Q.2 Make a web page having a picture at the background.
• Make a webpage in which one line moves left and one moves to right
both of green color.
• Make a webpage using all the attributes of the marquee tag
• Make a page in which nested marquees are used
• Write your name with heading 2 and your father name with heading
5.
23. Assignment
Q.1 Make a webpage in which the text moves from left it must be bold,
italic and underline.
Q.2 Make a web page in which one line is bold one is italic and one is
underline.
Q.3 Make a web page in which the following text is shown in the same
formatting.
This is Bold, Italic and Underline text.
24. Assignment
• Make a webpage with blue background the text must be in green
color, the size of the text must be 4 and the style of text must be arial
black.
• Make a web page having two paragraphs one in green color and one
in blue color.
• Write HTML code that display an essay of two paragraphs. The
heading of essay should appear Italic in the center. The first paragraph
should aligned left in green color. The second paragraph should be
aligned right in green color.