HTML Background


Backgrounds

HTML and CSS provides many ways of changing backgrounds in web pages.
This page explains the industry standard way of creating backgrounds in HTML. Feel free to copy and paste the background code into your own website, blog, MySpace page, or other HTML document. And feel free to modify the code as you like.
Also, please consider keeping the link back to this website – if you do it will be very much appreciated!

HTML Background

The quickest HTML code for backgrounds is the background property. Strictly speaking, this is a CSS property but you use it in conjunction with your HTML code. The background property is a shorthand property for setting all background properties at once.

Example Code

The source code (on the left) results in the HTML background (on the right).

Source Code Result

This example sets all the background properties with one property – the ‘background’ property. This keeps the code shorter and easier to read.

This example sets all the background properties with one property – the ‘background’ property. This keeps the code shorter and easier to read.

Page Background

To set the background for the whole page, simply apply the background property against the body tag.
Example:

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s