HTML Page Structure

HTML Elements
HTML Attributes


HTML Background Attribute

HTML Background Attribute is used to set background for web page in the form of color, image etc. If you want to place an image in the background of your web-page, you can use background element of HTML. However, its use has been replaced by the use of CSS.

Syntax

<table height="100" width="150" background ="image.jpg">

Background Example

<!DOCTYPE html>
<html>
<head>
<title>Background Example</title>
</head>
<body>
<table height="100" width="150"
 background="../images/nature.png">
<tr><td>Welcome to TechStrikers</td></tr>
</table>
</body>
</html>

This will produce following result

Welcome to TechStrikers