html_tutorial pdf

18. HTML – BACKGROUNDS

18. HTML – BACKGROUNDS HTML By default, your webpage background is white in color. You may not like it, but no worries. HTML provides you following two good ways to decorate your webpage background. Html Background with Colors Html Background with Images Now let's see both the approaches one by one using appropriate examples. Html Background with Colors The bgcolor attribute is used to control the background of an HTML element, specifically page body and table backgrounds. Following is the syntax to use bgcolor attribute with any HTML tag. This color_value can be given in any of the following formats: Example Here are the examples to set background of an HTML tag: HTML Background Colors 88

HTML This background is yellow This background is sky blue This background is green This will produce the following result: This background is yellow This background is sky blue This background is green Html Background with Images The background attribute can also be used to control the background of an HTML element, specifically page body and table backgrounds. You can specify an image to set background of your HTML page or table. Following is the syntax to use background attribute with any HTML tag. Note: The background attribute is deprecated and it is recommended to use Style Sheet for background setting. The most frequently used image formats are JPEG, GIF and PNG images. 89