FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Accurate background size to monitor

 


Sparda
I have made a background for my webpage and the page looks fine on my own monitor, but on others maybe not. I tried viewing the site on another computer which had a Larger screen, and the background isn't its full size. There is areas towards the right and below that are white. It is as if I were needed to make the image file larger. If I would do this, people that have monitors like me will have a very bad quality image for the background. Is there some way I could make it so the background goes to the right size to fill according to the monitor size? My Image file is currently 1022X722.

Current code I am using:

Code:
<style type="text/css">
body
{
background-image:
url('MyFile.jpg');
background-repeat:
no-repeat;
background-attachment:
fixed
}
</style>


~Thx in Reply
RT Cunningham
What you ask is impossible. Having said that, there are ways to make it possible, by using features added by JavaScript and PHP.

The best solution is not to use a full image for a background, but a repeating one. That doesn't work if you're using a complete picture. Another option is to reduce the picture to the lowest common monitor resolution, which I believe is 800x600. (It used to be the horrid 640x480, but I haven't seen that myself in years.)

If you're looking for a solution for every resolution, you won't find it. Sorry.
Maxus
it is possible:
add the image in your body,
use layers and lay in under all the rest, and set with javascript height en width (browser document.body.clientWidth )
RT Cunningham
The original poster said:

Sparda wrote:
It is as if I were needed to make the image file larger. If I would do this, people that have monitors like me will have a very bad quality image for the background.


Then I said:

RT Cunningham wrote:
What you ask is impossible. Having said that, there are ways to make it possible, by using features added by JavaScript and PHP.


Then you said:

Maxus wrote:
it is possible:
add the image in your body,
use layers and lay in under all the rest, and set with javascript height en width (browser document.body.clientWidth )


Didn't I say he could do it with JavaScript and PHP? Your JavaScript only solution will do what he does not want.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.