Double Backgrounds?

This is a discussion on "Double Backgrounds?" within the Web Page Design section. This forum, and the thread "Double Backgrounds? are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 26th, 2006, 00:51
New Member
Join Date: May 2006
Location: California
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Double Backgrounds?

Here's a rough aproximation of what I want:

http://img.villagephotos.com/p/2003-...219/divex1.jpg
http://img.villagephotos.com/p/2003-...219/divex2.jpg

Notice that when the screen is resized, the white space in the middle grows smaller. One image is aligned to the top, and the other is aligned to the bottom.

I want to get this effect through a CSS background. Here, I'll just say what I mean in this way: below is what one might imagine the code to look like (if this code actually worked).

Code: Select all
body
 {
 background-image:url(backgroundtop.jpg);
 background-repeat:repeat-x;
 background-position:top;
 background-attachment:fixed;
 }
body
 {
 background-image:url(backgroundbottom.jpg);
 background-repeat:repeat-x;
 background-position:bottom;
 background-attachment:fixed;
 }
But as I've said, that doesn't work. What would? I need the images to be in the background because there will be tables on top, tables that will cause the page to scroll. I want those images to remained fixed in their position. I don't want to just include the white space in the background image, though, because then the site would only look good in one resolution. Anyone have any ideas?
Reply With Quote

  #2 (permalink)  
Old May 26th, 2006, 02:10
craig's Avatar
Reputable Member
Join Date: Sep 2005
Location: Preston, UK
Age: 21
Posts: 381
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to craig
Re: Double Backgrounds?

cant have 2 defined backgrounds in CSS,
you can only use a color and a background.

Unless you use overlappding divs but that would prob require png's which would screw up in IE
Reply With Quote
  #3 (permalink)  
Old May 26th, 2006, 10:32
Up'n'Coming Member
Join Date: Nov 2005
Location: England
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Double Backgrounds?

use a div with a background for the top and place the bottom bg on the body tag.
Reply With Quote
  #4 (permalink)  
Old May 26th, 2006, 13:01
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Double Backgrounds?

I think the most flexible solution is to have three divs, one each for the top and bottom with their height fixed and their image as a background. Have your third div as the middle section which takes up whatever space is available.

Set the z-index for these three divs to 0 (zero); Make sure any other layout divs have a z-index greater than this so that they always site on top.
Reply With Quote
  #5 (permalink)  
Old May 26th, 2006, 13:03
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Double Backgrounds?

Am I missing something? Why don't you just do 3 div's with different backgrounds? You really shouldn't need a "clear" command although you might have to enforce the width with a hack (like a .gif 1px high across a div) in one or more browsers. You shouldn't even need a wrap division for this.

Code: Select all
 #divTop     {width: 1000px; height: 300px; background: url();}
#divMiddle  {width: 1000px; height: auto; background: #fff; clear: both;}
#divBottom {width: 1000px; height: 300px; background: url();clear: both;}
If you want it liquid you can do it without much trouble; you'll just have to make sure all browsers follow the "width: 100%;" style, and if not, use something to keep the div's at full width.

Last edited by masonbarge; May 26th, 2006 at 13:08.
Reply With Quote
  #6 (permalink)  
Old May 27th, 2006, 12:42
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Double Backgrounds?

I'm thinking it will be width problem if anything. I assume he has a 1px wide repeating background, that will hold the box up but won't help expand it.
Reply With Quote
Reply

Tags
double, backgrounds

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
implementing a Double Slider pesho318i JavaScript Forum 5 Nov 20th, 2007 12:47
double click ahwell Flash & Multimedia Forum 3 Sep 7th, 2007 20:40
Double Down colinmcgray Free Web Site Critique 8 Jun 14th, 2007 11:40
IE 7 problem - double padding? edd_jedi Web Page Design 2 Nov 21st, 2006 15:31


All times are GMT. The time now is 19:31.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43