FORUMS: list search recent posts

How to make a background go beyond the boundaries of the element (CSS)?

COW Forums : Web Design

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tevya Washburn
How to make a background go beyond the boundaries of the element (CSS)?
on Jul 6, 2009 at 10:47:40 pm

I have a site I'm working on, and the footer section moves up and down depending on the length of the content. I'm using a design where the background of areas of the page appear to run clear from one side of the browser to the other, even though the content is only near the center. The main background image accomplishes this for the header and the content area.

However, because the footer area is such that it can adjust from page to page, based on the length of the content, it needs its own background. But since the footer is inside the main content wrapper of that holds the rest of the page in the center, the background of the footer only goes to the widths of the main content area.

Is there a way to tell just the background image of the footer to start all the way on the left and go all the way right (beyond the wrapper boundaries). I assume there must be a way with absolute positioning, but after looking through w3schools.com's CSS2 reference and not finding the right thing, I thought I'd ask here.

Thanks in advance for any help.

--Tevya


Return to posts index

Fernando Mol
Re: How to make a background go beyond the boundaries of the element (CSS)?
on Jul 7, 2009 at 12:27:31 am

please post a link to your site


Return to posts index

Tevya Washburn
Re: How to make a background go beyond the boundaries of the element (CSS)?
on Jul 7, 2009 at 4:21:48 am

donerightutah.com

Its all just the default stuff for the WP theme. I want to be able to put a white background image behind the black 3-column footer area, but have the background go edge-to-edge like the header area does. Thanks.

--Tevya


Return to posts index


Fernando Mol
Re: How to make a background go beyond the boundaries of the element (CSS)?
on Jul 7, 2009 at 5:48:20 am

The trick with CSS layout usually is in understanding the box model.

Your footer is a box and you want it to have the width of your page, but your footer is inside another box, your wrapper, and your wrapper has a defined width.

You need to put your footer outside your wrapper so it normally fills the width of your page.

If you want your footer to has the same width of your wrapper but the background extend from side to side, you can end your wrapper, add a div for your bg footer color and inside place your centered footer with a fixed width.

Am I making any sense?


Return to posts index

Tevya Washburn
Re: How to make a background go beyond the boundaries of the element (CSS)?
on Jul 7, 2009 at 2:45:00 pm

Yeah, that makes a lot of sense. And was kinda what I was thinking I would have to do. I was hoping that there was a way to give the background image an absolute position so that it would go beyond the bounds of the footer and wrapper. A little CSS to do this (if possible) would be a lot easier than restructuring a large portion of this WP theme.

I know I've made images position outside of the wrapper and such with CSS, but I'm no expert and can't remember how. I just thought that maybe there was a way to do the same with a background image. Anyone have any ideas?

--Tevya


Return to posts index

Fernando Mol
Re: How to make a background go beyond the boundaries of the element (CSS)?
on Jul 7, 2009 at 3:22:34 pm


Well, if you want to use CSS then you can add a background image to your BODY tag, repeat it on the x and algin it to the bottom. But I don't know if that's a better solution, because if anybody changes the default font size of his broser (beleve me, a lot of people do that) then it's possible your layout will mess up.


Return to posts index


Tevya Washburn
Re: How to make a background go beyond the boundaries of the element (CSS)?
on Jul 9, 2009 at 1:41:32 pm

I did as you suggested. It took some doing, but is working. I've just gotta figure out how to center the footer area now.

--Tevya


Return to posts index

Fernando Mol
Re: How to make a background go beyond the boundaries of the element (CSS)?
on Jul 9, 2009 at 3:49:25 pm

You can place another div inside with a fixed width and center it the same way you are centering the rest of your elements

margin-left: auto;
margin-right: auto;


Return to posts index

Tevya Washburn
Re: How to make a background go beyond the boundaries of the element (CSS)?
on Jul 15, 2009 at 5:48:39 pm

Finally got it! Thanks a lot for all your help. I really appreciate it.

--Tevya


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]