StuBlackett
StuBlackett

Reputation: 3857

CSS Background Image

I've asked this question before : CSS Background Image

Its not as such a repeated question though. In that I've now got a set image size of 1280 x 1024. But the problem I've got is that on larger screens the background etc dissapears. In the previous question it was suggested to try keep the elements fixed.

Does anyone have a solution for me on how to get this design to work on larger / smaller screen sizes? I've considered making the image 12 times and try find some JavaScript to get the browser size then start the background image based on that?

I'm aware of other issues on the page. I just want to get the background sorted first.

An example of my page is HERE

Thanks in advance.

Upvotes: 0

Views: 266

Answers (2)

Sotiris
Sotiris

Reputation: 40066

Remove the background image from body and add it in html: <img src="http://www.stuartblackett.com/picturebook/images/bg1.jpg" id="background" />

Then in your css add the following:

#background { width: 100%; position: absolute; top: 0; left: 0; }

Demo: http://jsfiddle.net/XW9Pz/

Upvotes: 1

cederlof
cederlof

Reputation: 7383

Will it work to set

background-attachment:fixed;

?

See: http://www.w3schools.com/css/tryit.asp?filename=trycss_background-attachment

Upvotes: 0

Related Questions