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.
views:
79answers:
4Don't you mean lightbox technique? http://en.wikipedia.org/wiki/Lightbox_%28JavaScript%29
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.
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/
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.