Jump to content

Background 100% Screen Setting ?


GoDxNero
 Share

Recommended Posts

I have seen how to change background to always 100% depends on your browser size. But its really annoying because it change all the time when you change the size of your browser . So is there a way for background to always be 100% depends on your sreen resolution setting and not the size of your browser? So if I got a background of 1280x960 and a screen resolution of 800x600 the background image will become 800x600. But since it not depend on browser height and width the "100%" command prolly not work. Can I solve this probleem somehow with javascripts ? Like "get screen resolution setting" and "change image-background to it" ?

Link to comment
Share on other sites

I'm not sure what you're referring to. Do you want the background image to stretch to take the screen width or do you just want it to repeat or are you asking for something else?

Link to comment
Share on other sites

Is there a known way to change background width or height ? I want to make a function which detects screen resolution and put them in a variable, then use that variable to change the width and height of my background . Is that possible too ? the body background I mean. Well I think this can be solved if I put another big div to wrap the entire page together and put my main background here, then I can change the width and height of the image I guess. But its not so handy ><. Wanna see if change body background width and height possible first : )

Edited by Nero
Link to comment
Share on other sites

yes

img#bg {position:fixed;top:0;left:0;width:whateverpx;height:whateverpx;z-index:-1;}#content {z-index:1;}

<body><img src="blah.jpg" id="bg" /><div id="content">all content</div></body>

Edited by smerny
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...