= color The default text colour of body section is “black”, it is often called as automatic color. text attribute within body tag is used to change the text colour. The tag to change body text colour: <body text = / > <html> <head> <title> Background Colour change </title> </head> <body bgcolor = #FFFF00> This is my browser with different colour </body> </html> Illustration . – HTML code to change background and text color of a browser’s body To the above code, text will be displayed in Red color on yellow background.
You can also use colour code instead of colour name. (iii) Background image: background=image An image or picture can be applied as background to a webpage. When you insert an image as background, the text will be displayed on top of the image. Background images can be a texture or bitmap or even a photo.
When you insert a small image, the browser takes the image and repeats it across and down to fill browser window. Inserting animated images (GIF images) creates more interesting. The tag to apply an image as background: <body background = “ ”> Chapter Pages <html> <head> <title> Image as background </title> </head> <body background = “flower01.gif”> This is my browser with an image as background </body> </html> Illustration . – HTML code to apply an image as background While including an image as background, the image file name is not required to be in double quotes.
The code <body background = flower01.gif> can also produce the same result. If your image file name is long or split as two more words or along with path, should be specify within double quotes. Remember that, if the image file and HTML source are located in different locations i.e. in different folder or drive, file path should be clearly specified along with image file name.
In the above case, image file and HTML source file both are located within the same folder. So, path name is not mentioned. For example, If the image file is somewhere in a folder (say Images