CSS Background Images

body {
background: white url(images/bg.gif) no-repeat top right;

This amalgamates these properties:

* background-color, which we have come across before.
* background-image, which is the location of the image itself.
* background-repeat, which is how the image repeats itself. This can be repeat (equivalent to a ’tile’ effect across the whole background), repeat-y (repeating on the ‘y-axis’, above and below), repeat-x (repeating on the ‘x-axis’, side-by-side) or no-repeat (which shows just one instance of the image).
* background-position, which can be top, center, bottom, left, right or any sensible combination, such as above.


2 thoughts on “CSS Background Images

  1. Try to use WordPress

    body { font-size: x-small; }

    when writing code, it looks very nice.

    Also instead of top right I would suggest top center for no other reason other then that it will degrade well when the screen is shrunk, by keeping your name which is usually in the center still visible.

    Also you can place units instead of top left right center.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s