Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Posts
    405
    Thanks
    17
    Thanked 2 Times in 2 Posts

    footer div and structure confusion.

    This is driving me nuts! My brain just can't seem to grasp how to get divs to align right and have the footer stay at the bottom.

    The page I'm trying to figure out is here:
    http://www.twigzy.com/test_workshop/subpage3.php

    the white space with the small logo is supposed to be at the bottom, but something is putting extra space underneath with the green background from the"textbox1" div.

  • #2
    New Coder
    Join Date
    Feb 2012
    Location
    England
    Posts
    77
    Thanks
    0
    Thanked 12 Times in 11 Posts
    Orgainse your divs like this
    -One large div called conatiner
    --Inside that a div called main
    ---Inside main your main content
    --Outside main another div called footer

    To get a div to align right use float:right;

  • #3
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,949
    Thanks
    9
    Thanked 724 Times in 718 Posts
    Quote Originally Posted by Co1dFusion View Post
    To get a div to align right use float:right;
    I rather think the OP meant they wanted their divs to align correctly, not on the right.

    It's not so much the structure of your website in terms of divs that's the immediate issue here, but your use of absolute positioning, height and top values within your css. This is causing elements to appear in unexpected places and I don't think there's a very quick fix.

    The problem with using absolute and top and left positions is precisely what you see here, in that many things need to be changed to add another element.

    I'd be inclined to start again, create some divs called #header,#content and #footer, get your content within those divs, without any positioning at all, just let the document flow take care of itself. Then worry about the logo on the left and your social media buttons. I'd expect that redoing that will be quicker than trying to sort out all your current positioning and will certainly be easier to maintain going forward.

    Your doctype needs to be right at the top, before all those conditional comments as well, otherwise IE will not play nicely....


  •  

    Posting Permissions

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