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’s great !
I really appreciate your explanation.
It’s help me a lot.
: )
Thats wicked – Cheers!
http://www.graylabel.co.uk
Pretty useful article. Thanks for that. Exspecially the last solution with the html&body background.
Good post, I really like the double image concept and think I am going to play around with it.
I wrote a short post on how to embed a very large swf file and keep it centered with CSS if anyone is interested in that.
This article came at a nice timing. I just wrote a WordPress tutorial on using Custom Field, so each WP blog entry can be customized to have its own look. In my specific examples, I included the use of a large background also.
http://www.8164.org/wordpress-custom-field/
I hope someone finds this helpful.
thank to share
Nothin to advanced here, tho always appreciated.
In your first example, what do you mean by “two extra lines in the body element?” Im guessing you meant ’2 extra declarations in the body selector” (width & height)? I’ve never experienced this so I’ll have to check it out.
Thanks again
I’d probably still go with a #wrapper on the cloud for one reason – is the image content or design? Putting it in content is mixing presentation and markup, so it’s a trade-off really. While superfluous divs are bad I think the ability to redesign solely from the CSS file is more important than that 1 extra div.
Nice article (pics always sell me).
Awesome! Ive been trying to do this for sometime. Can’t believe i didn’t think of using the HTML tag to add a background – http://www.dubblevision.com
Cheers :)
Thanks. I am finding this tutorial. it’s helpful.
very useful tips you have here.
Thanks! I always like your CSS tutorials!
Logic applied to webdesign. Good article.
Wow Nick, another great tutorial. Thanks heaps for sharing this. Looking forward for another great tutorials from you
Hi!
Great article!
Ah this is very logical and usefull, thanks mate
Conrad Gorny
Freelance Graphic Designer
http://www.conradgorny.com
Great article, but i have a doubt. “display: table” i do not understand this. Can someone explain me?
Thanks you all, and greetings from Argentina
Good work!
Thanks for share it here.
Thanks for the tip. Working with large backgrounds is one of the earliest CSS problems a designer faces. This is a great tutorial on a solution.
Great tip on using the HTML tag for backgrounds too. I’ve always used a “wrapper” like you did in the example. There goes the wrapper. Thanks!