| View previous topic :: View next topic |
| Author |
Message |
Drui

Joined: 11 Jul 2006 Posts: 541 Location: 'Jersey :}
|
Posted: Tue Aug 22, 2006 3:51 am Post subject: html helpline |
|
|
Every time I start a thread I am afraid I'm gonna get flamed... but I need html help, and many of you are handy in that manner, and I don't wanna go digging to see if anyone has already posted this.
How can I set the background image of a page to resize so that the whole image fits regardless of the viewer's resolution?
If anyone else has html questions, please feel free to post them here. _________________ fight |
|
| Back to top |
|
 |
smeat

Joined: 09 Jul 2006 Posts: 542 Location: Shmocation
|
Posted: Tue Aug 22, 2006 4:04 am Post subject: |
|
|
As far as I remember this is not possible. If you check out the "Question: What's the highest resolution you've seen?" topic you will see another discusion about this. There are also some good ideas there as well. _________________ Allowed to live by the good graces of Deleted, Shh.
"We've been attacked by the intelligent, educated segment of the culture." - Ray Mummert, creationist, Dover Pennsylvania, 2005 |
|
| Back to top |
|
 |
Dro

Joined: 10 Jul 2006 Posts: 3830
|
Posted: Tue Aug 22, 2006 5:00 am Post subject: |
|
|
You could call a Perl script that takes the window size as an input and then calls GD to resize a graphic on the fly and save it to disk for use as the background.
I'm surprised I can't think of a web site that actually does that, even though it would be horribly inefficient and slow and kludgy. |
|
| Back to top |
|
 |
kame
Joined: 11 Jul 2006 Posts: 2563 Location: Alba Nuadh
|
Posted: Tue Aug 22, 2006 2:11 pm Post subject: |
|
|
You could use javascript to determine the window size, and then have php (or any other scripting language) select the background from a series of differentiated resolutions of the same picture.
But really, one giant background? That's bad form  _________________ bi-chromaticism is the extraordinary belief that there exists only two options
each polar opposite to each other
where one is completely superior to the other. |
|
| Back to top |
|
 |
strangemusic

Joined: 09 Jul 2006 Posts: 305 Location: Vancouver, BC and Kingston, ONT
|
Posted: Tue Aug 22, 2006 2:17 pm Post subject: |
|
|
| q: won't this MANGLIFY the quality of the image if it's less-than-astronomical resolution? |
|
| Back to top |
|
 |
Drui

Joined: 11 Jul 2006 Posts: 541 Location: 'Jersey :}
|
Posted: Tue Aug 22, 2006 2:18 pm Post subject: |
|
|
kame - Yeah, I know. I'm trying to figure out what to resize the image to in order to be efficient, but I don't want users with minute resolutions to see some kind of ugly border on the background image. _________________ fight |
|
| Back to top |
|
 |
kame
Joined: 11 Jul 2006 Posts: 2563 Location: Alba Nuadh
|
Posted: Tue Aug 22, 2006 2:24 pm Post subject: |
|
|
| strangemusic wrote: | | q: won't this MANGLIFY the quality of the image if it's less-than-astronomical resolution? |
a: gd isn't the best at resampling images, but it does the job.
drui, what does this background look like, can you post a pic? _________________ bi-chromaticism is the extraordinary belief that there exists only two options
each polar opposite to each other
where one is completely superior to the other. |
|
| Back to top |
|
 |
Drui

Joined: 11 Jul 2006 Posts: 541 Location: 'Jersey :}
|
Posted: Tue Aug 22, 2006 2:45 pm Post subject: |
|
|
Of course, anything for you kame.
Original image is 1710x1362. Way too big, but what to do?
I intend to play with the opacity too. _________________ fight |
|
| Back to top |
|
 |
kame
Joined: 11 Jul 2006 Posts: 2563 Location: Alba Nuadh
|
Posted: Tue Aug 22, 2006 3:09 pm Post subject: |
|
|
That image is too pretty to have text, and tables, and other stuff crawling all over it. Please, in the name of all that is good design practice, don't use that image.  _________________ bi-chromaticism is the extraordinary belief that there exists only two options
each polar opposite to each other
where one is completely superior to the other. |
|
| Back to top |
|
 |
mantismag

Joined: 09 Jul 2006 Posts: 81
|
Posted: Tue Aug 22, 2006 4:23 pm Post subject: |
|
|
the answer to your question is that this is not possible in html+css. the only way to do this is with scripting. dro mentioned perl and gd. there's also php and imagemagick. i wouldn't do it though.
unfortunately the picture would not make a very good background image unless you manage to position it exactly. the fact that it ranges from bright to dark will make finding a good contrasting color for your text troublesome. the main point of interest is the ground and the sunset. as such it would make an excellent header or footer image if you crop out just that bottom quarter of the image. and if you used an <img> as your header or footer you could resize it and center it. it would also eliminate the need to mute the colors in order to make your text readable. |
|
| Back to top |
|
 |
Michael

Joined: 09 Jul 2006 Posts: 10431
|
Posted: Tue Aug 22, 2006 11:43 pm Post subject: |
|
|
or you could slap on a big semi-transparent white box with a light stroke around it, some sort of shadow etc. it'd still be huge though  |
|
| Back to top |
|
 |
|