HTML Backgrounds

In HTML webpage background can be changed by colors or images

Background with Colors in HTML
Background can be changed using bgcolor attribute

Syntex

<yourtag bgcolor="color">
Content goes Here…
</yourtag>

<yourtag bgcolor="#cccccc">
Content goes Here…
</yourtag>

Example

<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>

<table bgcolor="red">
<tr><td>
Content Goes Here…
</td></tr>
</table>

<table bgcolor="#000000">
<tr><td>
Content Goes Here
</td></tr>
</table>

</body>
</html>

Background with Images in HTML

Background can be changed using background attribute. You can specify an image to set background of web page.

Syntax.

<yourtag background="ImageURL">
Content Goes Her
</yourtag>

Example

<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>

<!– table background –>
<table background="image.png">
<tr><td>
Content Goes Here
</td></tr>
</table>

</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *