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.
whoah, it’s nice but… I don’t know if 1280px is large..
Ahh sorry, I thought the image was going into the HTML, ignore my last comment (duh)… mmm HTML selector is not a bad idea at all. In fact, it’s kind of obvious after the fact. Nice work.
I have a query with Common Mistake,the bgimgage is not tally with the bgcolor.if reader do it like this .i thinks the result maybe not well.
Good article, display:table on the body tag for the firefox issue is a nice tip.
Another tip: For very complex bgs, another good method can be to use absolute positioned divs (just for the bgs). I do this aswell if I want a bg color behind the image (for the sake of a more elegant load) or I want to overlap divs with bgs.
Here is a example of what I mean (disabling bg images will make it clearer): http://www.pixel-house.com.au/pond/
Thx for Markup4U team ;-)
Good review
Thanks for sharing
Nice article.
You can also fix the background image thing by using a min-width property, you then dont get the background sliding after it has hit the min-width.
This works in all browsers as far as I can tell!
Just set the body to min-width:900px; or something. Pretty sure this works the same.
Still good article with some nice examples.
Great, nice article. Seems like the thing of the moment is to use huge backgrounds. Display: table is a great tip, but min-width does the trick too.
yeah large backgrounds are the best. i like pages with background photos. i have launched a new page with big bg fotos. i love it :)
check it: http://www.area241.com
Any one wants to participate in a logo design contest to win $125?
http://www.laptask.com/task/show_task.php?task_id=379
that’s very handy to know! as am busy updating my site atm!
thanks again for the tutorial…
http://www.mediacake.net
Another solution I’ve seen in the earlier post is the mirrored background image, so you can repeat it on the y axis and it never ends. Like in Surf in Paradise.
good with clouds, skylines, horizons…
I’d like to see a tutorial on how to have a website where there is a large background image that resizes to fit the browser window without having any scaling issues or the image being cut off on larger displays. A good representation of this is http://www.august.com.au/. Resize the window and you will see what I mean.
I know it has something to do with Flash, but I’m not really sure how this was accomplished.
Man, nice article.. i’m on development of a large bg web site now!
Thnx for sharing your technique!
Large image backgrounds become some kind of trend and I’m not sure it’s good… Anyway good post like always.
@MattZ
It’s flash based website
Thanks so much Nick! This is a technique I’ve used many times but the addition of “width: 100%; display: table;” is something I kept looking at your CSS to figure out… never could find it!
Wow… AWESOME!! Your tutorials are really fantastic… Your site is a master piece in itself.. Thanks for sharing this cool stuff.
Thanks for a useful tutorial and a great blog in general :)
Your current design and this post inspired me to design my very first word press theme based on a large background image like yours. I did a photo shop brush background like Web Designer Wall, but I am already working on a more photo based one.
Keep up the good work!