Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 17-02-06
Registered User
 
Join Date: Jan 2006
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
brussell78 is an unknown quantity at this point
  Background image stretch?

Hi, I am trying to find out whether, if I use a background image, it's possible to have the image stretch to the resolution of the viewers browser. I have tried using:

background:url(RosesBgd02.jpg) no-repeat center;

with the css but it only centers the image - The image is currently 800x600 so therefore any browser over this has a nasty border around the background picture. I know that I can put a background colour but I would prefer to not have this, and have the image stretch to the edges. Any clues please?

My HTML isnt great so please in english terms

Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 17-02-06
Paul Wright's Avatar
Fishboy
 
Join Date: Jan 2005
Location: London
Posts: 1,655
Thanks: 5
Thanked 8 Times in 4 Posts
Paul Wright is an unknown quantity at this point
Hiya, unfortunately the css background property doesn't take height/width dimensions so there's no quick fix for this one. The only way i can think of is to set the image within a div tag then change the z-axis so it sits behind your content. I would check browser compatibility though as this is a bit of a cheap hack.

You could try something like this I guess.
Code:
<div style="width: 100%; height: 100%; left: 0px; top: 0px; position: absolute; z-index: 0;">
<img src="image.jpg" style="width: 100%; height: 100%;">
</div>
Always better to resize the image in an art package though so you're starting off with the correct proportions.

Cheers
Paul.
__________________
Mediaedge:cia - Marketing's and Campaign's Media Agency Of the Year - 2007
e: paul.wright@mecglobal.com | t: 0207 803 2976 | m: 07834 697 130
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 17-02-06
Registered User
 
Join Date: Feb 2006
Location: Gillingham
Posts: 503
Thanks: 0
Thanked 0 Times in 0 Posts
Donk is an unknown quantity at this point
I think the only way you could do it would be by using the JavaScript onResize() function.

I have got round it on a site I am designing for a customer by using an <img src="whetever.jpg" width="90%"> tag. This site look similar in all screen sizes from 1600 *1200 to 640 * 480

View the source to get some ideas.

bob
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 17-02-06
eskimo's Avatar
Registered User
 
Join Date: Aug 2003
Posts: 659
Thanks: 0
Thanked 0 Times in 0 Posts
eskimo is an unknown quantity at this point
You could use some kind of screen resolution detection script, then load the appropriately sized background image through a stylesheet.


By the way the bbc have some kind of background image magic going on.
http://www.bbc.co.uk/bbctwo/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 17-02-06
Registered User
 
Join Date: Jan 2006
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
brussell78 is an unknown quantity at this point
Thanks for the responses, knew you'd have the answer.

I will have a play about with all the options and see what works out best.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image URL's in datafeeds B1gJo3 The Affiliate Marketing Lounge 12 14-10-07 05:45 PM
dynamic image problem pricethat Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 3 26-07-05 11:35 PM
Mouseover on sections of an image Wardy Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 9 21-03-05 06:33 PM
how to display image as image not as blabla.com/pic.jpg via phpMyadmin & Dreamweaver Matt Seigneur Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 5 17-12-04 12:39 PM
durr im thick, css & image borders morleymouse Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 5 02-09-04 10:10 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7