November 1, 201016 yr Hi. Thinking of a new design, wondering if it's at all possible... Imagine, for a second, you had a large image with a central point that was the focus. You wanted it applied to the body so the image takes up the whole page of a fixed, no scroll layout. The only problem is you want the centre point of the image to be in the centre of the browser window regardless of the size of the browser(with a minimum ofc). Kind of like when you use a #wrapper with margin: 0 auto;. The image would have to shift outside of the browser window. Is that possible? Hope it makes sense, ~evu.
November 2, 201016 yr Author I want to make the image suitable for 1024x768 as well as along the lines of 1900xW/E and I want the centre of the image to be in the centre of the browser. With a #wrapper the margins disappear as you resize the browser window, keeping the container central. I want an image to do the same thing, keeping the centre point of the image, like the #wrapper, in the centre of the browser. This would force the sides of the image to have to disappear, like the margins, outside of the browser window. Thanks Lev, I'm sure there's a reason that won't work, I just can't see it atm lol, it can't be that simple... Will try when I get home. Cheers, ~evu.
November 2, 201016 yr lev's code is right, except it should be 'center center'. For this to work the image needs to be bigger than most monitors' resolutions. e.g. <html> <head> <style> body {margin:0;padding:0;background:url(path-to-img.jpg) no-repeat center center;} #wrp {width:960px;margin:0 auto;background:rgba(255, 255, 255, 0.;} </style> </head> <body> <div id="wrp"></div> </body> </html>
November 4, 201016 yr Author lev's code is right, except it should be 'center center'. For this to work the image needs to be bigger than most monitors' resolutions. e.g. <html> <head> <style> body {margin:0;padding:0;background:url(path-to-img.jpg) no-repeat center center;} #wrp {width:960px;margin:0 auto;background:rgba(255, 255, 255, 0.;} </style> </head> <body> <div id="wrp"></div> </body> </html> For some reason, when you don't initially specify the position in the css but try center center in Firebug it doesn't work. I tried center center first off, didn't work on top and bottom though. But hey, it works now (or all along as the case may be...) Cheers anyway! ~evu.
Create an account or sign in to comment