Page 87 - TP_Play_V2.1_class7
P. 87
BACKGROUND PROPERTIES
The background properties are used to make changes in the background of a web page. The
various background properties and their values are given in the table:
Property Value Description Example
background-
Specifies the background color: green;
background-color Name of the colour colour to be used on the background-
web page. color: rgb(45,
109, 78);
Specifies the image to be background-
background-image URL of image used in the background image:url("D:\
on the web page. bg.jpg");
repeat, repeat-x, repeat-y, Specifies the repetition
backgound-
background-repeat (whereas, x-horizontal & of an image on the web
repeat:repeat-x;
y-vertical) no repeat page.
Create an HTML5 web page by using the background properties.
<!DOCTYPE html>
<HTML>
<HEAD>
<STYLE>
BODY {background-image: url("D:\tile.png");
background-repeat:repeat-y;}
H1 {background-color:green;
text-align:center;}
</STYLE>
</HEAD>
<BODY>
<H1>Tiles</H1>
</BODY>
</HTML>
More on HTML5 85

