SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist cgacfox's Avatar
    Join Date
    Feb 2005
    Location
    Colorful Colorado
    Posts
    412
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Footer in it's own container does not respond well with the rest of the page

    I received help before for a footer problem. I wanted the footer to stretch the length of the browser window no matter what size that was. In order to do this I had to put the footer element in its own container. Now I am trying to style that container so it lines up with the rest of the page and still be responsive. Because it is in its own container that is not working too well. I am now wondering if I need to make the page container 100% instead so that the footer background image stretches and I can keep the styling of the footer as it should be. Any thoughts on this? Site is at http://foxdenwebsolutions.com/foxden3/index.html.

  2. #2
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Best to not say 100% because some times that's all you will get. As default it will go 100% and further when needed. Just give it the same exact positioning as your main container. If main had margin auto then give it margin auto and etc.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,549
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    If I understand correctly and all you wanted was the footer background to stretch to 100% then you would need to nest an inner element inside the footer to hold the actual text content; the outer footer wrapper just holds the background. This inner element would be the same width as your main container and then use margin:auto to center it and it will align with the content above.

    You would also need to apply any responsive changess that you have set up for the main container and apply it this inner footer element also or it won;t resize at the same breakpoints.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •