how to use image as background in css

body {
    background-image: url("paper.gif");
    background-color: #cccccc;
}

CSS Syntax

background-image: url|none|initial|inherit;

Property Values

Value Description
url('URL') The URL to the image. To specify more than one image, separate the URLs with a comma
none No background image will be displayed. This is default
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Example

Set multiple background images for the <body> element:
body {
    background-image: url("img_tree.gif"), url("img_flwr.gif");
    background-color: #cccccc;
}

Post a Comment

0 Comments