views:

79

answers:

4

Is there any tehnical term for the full-image centered technique?
Example: topgear.com, http://safe.tumblr.com/theme/preview/979, and many others which I don't recall.

A: 

Don't you mean lightbox technique? http://en.wikipedia.org/wiki/Lightbox_%28JavaScript%29

Viktor Stískala
+1  A: 

You can either create a large size image (e.g. 2000px width/height) and set it as a background with background-position: 50% 50%. Or you can add an <img src="background.jpg" width="100%" height="100%" /> at the the body tag and position it absolutely that it will be stretched according page size.

fantactuka
Backround-position: 50% 50% does not center it vertically and horizontally. It sets the starting point of the bg to the center of the screen.
Andrei
A: 

I don't think it has a specific name. Here's an article with some state-of-the-art tricks:

http://www.alistapart.com/articles/supersize-that-background-please/

Álvaro G. Vicario
Thanks, this is what I was talking about
Andrei
A: 

I don't think so, no. The image is just placed inside the master div (in this case #wrap). It has some right and left padding to it so it will be set in the exact middle. You can however use an image with the same size as the master div.

Here is the code that website uses:

#wrap {

background: url("http://static.tumblr.com/xsp9wak/xAOkloi15/background-top.jpg") no-repeat scroll center top transparent;
margin: 0 auto;
overflow: hidden;
padding-left: 28px;
padding-right: 28px;
position: relative;
width: 905px;

PS: There are many ways to accomplish this.

Dan