| | Is it possible to do with html. I have found a few solutions but they dont seem to work. I know it is possible in java. But anyone have the code for html? Would really appreciate it. |
|
|
Isn't it just: background: url(yourimage.jpg);
CODE <body bg="url.img"> you need it fit any resolution.your backgroud must be so little then it can expand your screen. QUOTE(complexity @ Jun 16 2005, 06:07 AM) Is it possible to do with html. I have found a few solutions but they dont seem to work. I know it is possible in java. But anyone have the code for html? Would really appreciate it. 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.
Background images are just like normal images in HTML documents, you can't set them to resize to whatever the user has.
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:
I am assuming you have some high-resolution image that scales down very well, because most resizing doesn't work very well when there are big changes. I am also assuming your background image doesn't work when you put the image side-to-side, repeating both left-to-right and up-to-down, if that works all you have to do is add CODE body {
background-image: url(your-background.image); background-repeat: repeat; } CODE 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 CODE <script type="text/javascript"src="/index/homepage.js"></script> right before your main content in the homepage. Then make this file: CODE document.write("</div>"); Name it divclose.js. Place the following code after your content: CODE <script type="text/javascript"src="/index/divclose.js"></script> This is untested, but I am almost positive it would work.
Uhm, what good would that script be? It makes a div which is somewhat smaller than the screen it is viewed in. And depending on the contents of the div you might get a clipped or crunched image inside it...
Recent Queries:-
Keywords : background, fit, resolution, hmmm
html (4) OK so i've given up on the paint for background now how would i get it to look like this please? :) (6) Ok heres the scoop, i got a background that i made in paint for my website its just like 3 lines for how do u make a pic a backround?? (3) ?email me if u know! Trap17 forum asks you to post contributes with substance. .... I need a code to help out here please... (6) Hey everyone.. I was just wondering if there was a code/script that I could insert into my html Viewing Screen Shots No Matter Resolution (14) I am running into a HUGE problem creating a website. When viewing the site on 800x600 it views in (5) I have a menu page that consists of links to other pages. The page has a background image of a Just little reminder (10) Easy teahnic, post the following codes between and QUOTE <!-- (4) Does anyone have the javascript for a background to resize? I want my background to resize to (4) Hi: Ok, first off....moderaters, please move this topic to the appropriate category. I really Looking for background, fit, resolution, hmmm
|
|
![]() Background Fit Any Resolution - hmmm |
| ADD REPLY / Got an Opinion! | a humble request :-) | RAPID SEARCH! | Free Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute your information that might help someone here. Ask your Doubts & Queries to get answers.. "Together, We enlight each other!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|