Old 25-06-2009, 16:03   #1 (permalink)
plaxx
Registered User
 
Join Date: Jul 2005
Posts: 7
Scalable Background Images

Hey,

What is the best way of adding a background image and making it scalable, so it re-sizes with the correct aspect ratio (so the image doesn't distort).

Thanks,
M
  Reply With Quote
Old 25-06-2009, 16:08   #2 (permalink)
Rotuy
Limey
 
Rotuy's Avatar
 
Join Date: Apr 2008
Location: Liverpool
Posts: 4,747
Just make it a set size and fade it into the background colour. This way it looks good on high AND low resolutions, but depending on the size varies the amount of the image being shown.
__________________
  Reply With Quote
Old 25-06-2009, 16:42   #3 (permalink)
plaxx
Registered User
 
Join Date: Jul 2005
Posts: 7
Quote:
Originally Posted by Rotuy
Just make it a set size and fade it into the background colour. This way it looks good on high AND low resolutions, but depending on the size varies the amount of the image being shown.


Thanks for the reply.

I've used that technique for several projects in the past, but this one needs to have a full background image, which re-sizes dynamically depending on the size of the browser.

One solution I'm looking into is overlaying HTML on top of a SWF file, which will have the image. That SWF file will be scaled to fit the browser window proportionately.
  Reply With Quote
Old 25-06-2009, 16:51   #4 (permalink)
herkalees
Semantics, yay.
 
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
This might get you close to your goal; view the source: stu nicholls | CSS PLaY | 100% wide/high 'background' image emulation
__________________
  Reply With Quote
Old 25-06-2009, 18:01   #5 (permalink)
plaxx
Registered User
 
Join Date: Jul 2005
Posts: 7
Quote:
Originally Posted by herkalees
This might get you close to your goal; view the source:

Thanks for the reply.

I took a look at it, and it just might work. I just wish CSS3 or HTML5 would do something about this, seeing as how its become something regularly want to do, but have to resort to hack-ish ways of doing it, and still not getting good results.

My only issue with Stu's technique is that the image distorts when you re-size, and on widescreen monitor it's distorted to begin with.

Thanks for the link.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive
Web Hosting by Heart Internet, vBulletin © 2000-2009 Jelsoft Enterprises Limited.
Search Engine Optimization by vBSEO 3.0.0 RC8
Web Hosting by Heart Internet