| |
|
Welcome to KnowledgeSutra - Dear Guest | |
Background Fit Any Resolution
#4
Posted 17 June 2005 - 02:17 PM
complexity, on Jun 16 2005, 06:07 AM, said:
I dont think its actualy possible with just html but i know that you can do it with javascript. i found it on a site once where you just needed to change the url to the image in this code. Its a code that would resize according to the size of the window. but plain html? dont think so.
#5
Posted 19 June 2005 - 01:00 PM
You could use some PHP GD functions with some browser sniffing to resize the image before sending it to the client. What you'd have to do is this:
- When the user comes to your page, check what resolution they are using.
- Have a PHP function that resizes your background image to the resolution
- Set the generated image as background image
- Send all data to the user.
body {
background-image: url(your-background.image);
background-repeat: repeat;
}
#6
Posted 23 June 2005 - 01:55 PM
var jswidth = screen.width;
if (jswidth==800) document.write("<div class='main' style='width:63%;'>");
else if (jswidth==1024) document.write("<div class='main' style='width:72%;'>");
else if (jswidth==1152) document.write("<div class='main' style='width:75%;'>");
else if (jswidth==1280) document.write("<div class='main' style='width:77%;'>");
else document.write("<div class='main' style='width:63%;'>");
Name that file homepage.js for your convienience. Link to this file by using <script type="text/javascript"src="/index/homepage.js"></script>right before your main content in the homepage. Then make this file:
document.write("</div>");
Name it divclose.js. Place the following code after your content:<script type="text/javascript"src="/index/divclose.js"></script>This is untested, but I am almost positive it would work.
#8
Posted 06 September 2009 - 01:02 PM
hai htmlmaster..,
I developed my site in 1024*768 screen resolution, when I looked it in 1280*800 screen resolution it doesn't look the same, some tables looks expanded. Thanks a lot I used your code and now it looks as the same but aligned to left the problem is I want to align it to center in higher resolution.
please help..,
-question by jananraj#9
Posted 06 September 2009 - 01:06 PM
hai htmlmaster.., I developed my site in 1024*768 screen resolution, when I looked it in 1280*800 screen resolution it doesn't look the same, some tables looks expanded. Thanks a lot I used your code and now it looks as the same but aligned to left the problem is I want to align it to center in higher resolution.
please help..,
-reply by jananraj#10
Posted 16 October 2009 - 12:26 AM
I have struggled with the exact same dilemma, however I have recently figured it out.
Look no further!
Here is the link to the code and CSS:
http://stackoverflow...d/388817#388817
-reply by Brad
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users















