TechSpott - Computer and technology forums

Go Back   TechSpott - Computer and technology forums > Webmasters > Design & Developmet > HTML & CSS
HTML & CSS Place to talk about website design and get help with HTML, CSS, DHTML, etc.

Reply
 
Thread Tools Display Modes
Old April 4th, 2010, 02:49 AM   #1 (permalink)
Njordhrsdeath
Guest
 
Posts: n/a
Default how to stretch a background using html or css or anything?

I am designing a webpage and I need the background to have a 100% width, but the browsers cuts the image when it is too small or tiles it, leaving like a white 1px line between tiles which looks naff.
How do I get a background that covers the whole page?
Sorry, forgot to explain the background is a jpeg image.
  Reply With Quote Share with Facebook
Old April 4th, 2010, 02:50 AM   #2 (permalink)
Lie Ryan
TechSpott Newbie
 
Join Date: Apr 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Lie Ryan is an unknown quantity at this point
Default

In short: You can't.

In Long: CSS 3 will support stretching background, but currently no browser fully supports CSS3 yet (notoriously the antiquated IE6 is still the most popular browser). There are ways to fake it: http://webdesign.about.com/od/css3/f/blfaqbgsize.htm or another example: http://www.cssplay.co.uk/layouts/background.html

Better yet, try finding an alternative layout. Stretched image will look poorly stretched if the user's window size ratio isn't the same as your own screen's size ratio. The only image which looks ok with stretched background is flat color or simple gradients, both of which can simply use repeat instead.
Lie Ryan is offline   Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
background, css, html, stretch


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the html or css to apply a background image that will fit any browser? Nasty & S HTML & CSS 0 April 2nd, 2010 01:57 AM
In HTML/CSS can you have BOTH a background color and a background image SpacedOut HTML & CSS 0 March 31st, 2010 04:22 PM
Blue Background Blues Tnp Microsoft Office 0 March 24th, 2010 02:56 AM
Changing Excel's Background Color Eli Microsoft Office 0 March 22nd, 2010 04:24 PM
Change Background Image sufi Windows Vista 0 February 22nd, 2010 02:51 AM

 
Forum Stats
Members: 14,367
Threads: 20,375
Posts: 27,844
Total Online: 39

Newest Member: Gonsoushdug

Latest Threads

Advertisements

Support our advertisers!

Amazon
Sears
Macys
1800flowers.com
Drugstore.com


Carbonite Online-Backups
Tiger Direct
Tech Depot
Buy.com
Office Depot
Fatcow
HostGator


TripsNow.us
Marriott
Expedia
CheapTickets.com
OneTravel
Hotwire

Are you a Fan?

Share this on Facebook

Tag Cloud

Partner Links


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 06:21 PM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO