HTML Tutorial - Working with Images
(Page 5 of 12 )
It’s very easy to place images on a web page. Images can be of extensions .bmp, .gif, and .jpeg. However, gif and jpeg files are commonly used. They are applied using the <IMG> tag. An attribute called SRC is used to specify the path of the Image. The following code displays an image named ballon.gif on a web page.
Listing 11
<IMG src = "ballon.gif">
You can also specify attributes like Width and Height if required. ALT attribute will enable you to add a popup text when you move the mouse over the Image as shown in the listing below:
Listing 12
<IMG src = "ballon.gif" alt = “This is ballon.gif”>
Filling Background with Colors and Images
You can make the background of your web page to a specified color by using bgcolor attribute in the <body> tag. Following code will change the background of your page to red:
Listing 13
<BODY bgcolor = "red">
Similarly, if you require an Image to occupy the background of your web page, background attribute is used with the <body> tag as shown below:
Listing 14
<BODY background = "ballon.gif">
Next: Working with Tables >>
More HTML Articles
More By Anand Narayanaswamy
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|