25 views

Extended tag properties

Most of html tags we will learn have optional parameters and extensions. Here we will learn to extensions for <BODY> tag.

Background color for body of web page
If you want you can change background color of your web page by extending <BODY> tag as below.

<HTML>
<HEAD>
<TITLE>Page with Back Color</TITLE>
</HEAD>
<BODY BGCOLOR=”#0000ff”>
Page with Background Color
</BODY>
</HTML>

This will change your background color to blue. Format of color number is RRGGBB. You know that each color is a combination of three main colors: Red, Green and Blue. In color format RR is value of red component of the main color in hexadecimal format. GG is value of green component and BB is the value of blue component while “00″ represents “no value” for that color.

Two digit hexadecimal number can be anything between 00 to FF i.e. 0 to 255 in decimal format. So if we write 00FF00 we mean (red=0, green=255, blue=0) so the result is a pure green color. You can produce 16 million colors in this way but pay attention that not all of the browsers will be capable to show all these colors. So test your web page in 256 colors mode.

Putting Background Image in Your WebPage

We can use a background picture for web page instead of background color. You must have a ready image file in .gif, .jpg or .png formats. Now you must extend <BODY> tag as below. “background.gif” is file name of the image we want to use as background image.

<BODY BACKGROUND=”background.gif”>

Background Image  (Download this background image and use for your webpage)

Example:
<HTML>
<HEAD>
<TITLE>Page with background image</TITLE>
</HEAD>
<BODY BACKGROUND=”background.gif”>
<B>Page with background image.</B>
</BODY>
</HTML>

Note: Image file must be in the same folder as your html file. Otherwise browser will not be able to find it.

Do not use any html editing program like MS FrontPage . You must work
on the codes yourself.

Post a Comment

You must be logged in to post a comment.