Since I posted the huge collection of Large Background Websites, I received several email requests on how to make a large background site with CSS. So, I thought it would be a good idea to share my techniques on designing large background websites. In this tutorial, I will provide various CSS examples on how you can create a large background site using either a single or double images.
Common Mistake: Background Gets Cropped (see demo)
Take a look at the demo file, it looks fine under 1280px. But if you have a high resolution display, you will see the background gets cut off on the sides.

Example #1: Single Image (see demo)
A quick solution to fix the problem mentioned earlier: make the edge of the image the same color as the BODY background color. Here, I'm going to use Web Designer Wall as an example. Take a look at the image below and notice the edge is a solid color?

CSS Part
The CSS part is very simple. Specify the background image (position it center, top) for the BODY element.

Here is the CSS code:
body {
padding: 0;
margin: 0;
background: #f8f7e5 url(wdw-bg.jpg) no-repeat center top;
width: 100%;
display: table;
}
Notice there are two extra lines in the BODY selector. That is to prevent the background image from shifting when you resize the browser smaller than the content width (it happens in Firefox).

Example #2: Double Images (see demo)
For this example, I'm going to use the job board design, Design Jobs on the Wall. I have a cork board pattern repeating in the BODY tag and a wrapper background in the center.

The trick here is to export the GIF matte with a brown color that is similar to the cork board pattern.

Example #3: Sky Background (see demo)
In this example, I have a 1px gradient that is repeated horizontally for the BODY tag. Then I attached a cloud background in the center of the #wrapper tag.

Update: Sky Background Using HTML Selector (see demo)
Thanks to the comments from the readers. Below is an example of the sky background using HTML selector to display the gradient background, so the #wrapper DIV tag is not required. It is a much more cleaner approach.

Download the demo zip now and don't forget to check out the Large Background Websites.
Credits: thanks to Alex from markup4u.com for the {width: 100%; display: table} CSS trick.
That wasn’t really hard, but it was well explained, thanks Nick. Especially the “GIF-Trick” was well-implemented, keep up the good work!
Although large backgrounds at website look very nice it kills bandwidth and scares of visitors with slow internet connections.
So here are some tips&tricks how to use large background images and still have a fast loading speed:
- use the .gif extension (max 256 colors, with transparency support)
- use the .jpg extension with a higher compression (between 60 and 70)
- split the large image into smaller chunks, but requires some extra CSS
- load the background at the bottom of the HTML, requires some extra CSS
Nice to see you back !
Thanks. Seamless patterns are boring.
and it’s interesting to work with large background on footer, especially when image is higher than footer
That’s a very cool technique, every useful. Thanks a lot!
A good explanation for css beginners.
Have you thought about using the html selector when adding two images? One on html and one on the body.
short, but great tutorial, thanks a lot !
very geek trick!! I like the tiling image of sky from example #3..
in the past, i learned about this form your iTheme wordpress theme. Great Job Nick!!!
omg, i’m so waiting to get your new post, and now,,, very great technique,,, thanks nick
very very useful tips… maybe..ill start over my abandoned wordpress theme creation process :-) thanks 2u
@2 : I think several small images will take longer to load than a big, because of several server requests instead of one. Plus the ugly “mosaic-effect”…
Wow, this is great! I had to rethink one of my site designs because of this.
very nice article as always ;)
Thanks,
large background websites seem to be the in thing and once the image is cached you have a beautiful website that loads very quickly.
I personally have a large background on my blog (http://ozblog.com) and spent some time making the image wrap neatly so it would works on widescreen and high resolution displays.
Thanks again and the demo zip is a big help.
Thanks a lot for this tut. I’ll try to built large background site tonight.
it is as clear as noonday, but thx for work.
Cool!!! I love this tutorial. Congrats