HTML td+background=url+my logo = FSKED!!!!

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

HTML td+background=url+my logo = FSKED!!!!

Postposted on Thu Aug 07, 2003 6:07 pm

Okay i have setup a nice layout in pure html notepad so thats all im using. My layout, i enjoy, and can bee seen (nowhere near done) at
http://www.lazyjosh.com/piratepete.htm

The box with "logo goes here" is what im having trouble with. So far, everything is set via percents so that 800x600 see essentially the same thing as 1024 etc etc....

Now, i have an image i want to use as hte background for that specific table cell. It works when i apply it etc but it tiles it if its too small and looks ugly...

How can I a) have it stretch the image to fit the cell no matter the resolution the user is using, and b) keep it from tiling if the user has an insanly large scree res...

Any ideas? I'm using html and styles via css only. No programs alloud! :D
Corsair 600T | ASUS P8P67 PRO | Intel 2500k @ 4.4Ghz | EVGA 560 TI | G.SKILL Ripjaws Series 8GB | Corsair HX650 650W
steelcity_ballin
Gerbilus Supremus
Silver subscriber
 
 
Posts: 11924
Joined: Mon May 26, 2003 5:55 am
Location: Pittsburgh PA

Postposted on Thu Aug 07, 2003 6:21 pm

Should be some way to turn it off. I use my background via the css file and have to have the repeat command, cant you do something like that, define a css id segement with that background, or does it tile that by default too.
Aphasia
Grand Gerbil Poohbah
 
Posts: 3485
Joined: Tue Jan 01, 2002 7:00 pm
Location: Solna/Sweden

Postposted on Thu Aug 07, 2003 6:46 pm

i made a style element ..... td {background:no-repeat}



that works fine for reapeats, but how can i get the image to automatically fill in the gaps by stretching itself if its too small or scaling itself down if its too big....

Thanks!
Corsair 600T | ASUS P8P67 PRO | Intel 2500k @ 4.4Ghz | EVGA 560 TI | G.SKILL Ripjaws Series 8GB | Corsair HX650 650W
steelcity_ballin
Gerbilus Supremus
Silver subscriber
 
 
Posts: 11924
Joined: Mon May 26, 2003 5:55 am
Location: Pittsburgh PA

Postposted on Thu Aug 07, 2003 8:48 pm

If I get you correctly, what I usually do for these cases is to fix the size of the cell for your logo, say 500 x 300 or something. What you do is create a table with 3 columns, so the centre one is the one with the fixed length, or 500 width, and the ones on the right and left are set to percentages or * (no fixed length), so you don't have to worry about resolution scaling as the logo is always fixed, just the sides do the scaling.
*yawn*
etilena
Gerbil Jedi
 
Posts: 1669
Joined: Wed Jun 12, 2002 7:43 am
Location: .ozziefied.

Postposted on Sun Aug 10, 2003 8:30 pm

Well, you could use Javascript to change images depending on screen size. The syntax is:

Code: Select all
function getScreen()
{
     var height = screen.height;
     var width = screen.width;
}


Then Since u have fixed percentages for ur table, say 20%, just do a calculation for the screen size, i.e.

Code: Select all
var imageHeight = height * 0.2


And you wont need all that many images, since almost everyone uses two resolutions now, 800x600 and 1024x768
Windows XP - The 64-bit wannabe with a 32-bit graphics interface for 16-bit extensions to a 8-bit patch on a 4-bit operating system designed to run on a 2-bit processor by a company that can't stand 1-bit of competition
fc34
Minister of Gerbil Affairs
 
Posts: 2816
Joined: Wed May 08, 2002 8:39 am
Location: Somewhere


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 1 guest