Copyright © tutorialspoint.com

CSS - background-image

previous next


Description:

background-image defines a pointer to an image resource which is to be placed in the background of an element.

Possible Values:

Applies to:

All the HTML elements.

DOM Syntax:

object.style.backgroundImage="Any value as defined above";

Example:

Following is the example which demonstrates how to set the background image for an element.

<table style="background-image:url(/images/pattern1.gif);">
<tr><td>
This table has background image set.
</td></tr>
</table>

To Become more comfortable - Do Online Practice


previous next

Copyright © tutorialspoint.com