SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Footer Help

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Footer Help

    Hey Guys,

    I've recently created a website using CSS. The position of all elements is absolute rather than relative.

    However this has lead to some problems with the footer on each page. As each page is a different length then I've had to create a new footer ID for each page!! Which is very long! This will need to be change everytime new content is added to the pages!

    You can go to www.eliteclubbing.com/home.php.

    if you click the links you'll see that I've taken some of the footers off as i've been experimenting with various techniques but with no luck!

    I can post the code if you wish... but it can be viewed through the view source option on your browser.

    Any ideas?!... I'd just like one ID which can be used for all pages of all lengths!

    Thanks

  2. #2
    SitePoint Wizard bronze trophy DaveWoods's Avatar
    Join Date
    Dec 2004
    Location
    Derbyshire - UK
    Posts
    2,651
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure that if you're using absolute positioning then what you're asking is impossible to achieve.

    If you want a footer to be displayed at the bottom of the page then you'd be much better off using float's and margin's/padding to position elements.

  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,

    As Dave said you can't clear multiple absolute elements unless you resort to javascript.

    I've had a quick look at the page and I don't see why you have used absolute elements anyway.You seem to have floated elements and static content working ok and then you've stuck in an absolute element when another float or static content would have done.

    The best solution is to go back and change those elements to floated (or static depending on situation) and then just add clear:both to the footer and put it back in the flow.

    You can use absolute positioning if the element is a fixed height as long as you preserve the flow by some other means (e.g padding or margins to create space.). Most times though floats or static will do.


    Sorry there is no easy fix

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey guys,

    thanks for the feedback.

    i've initially used relative positioning but when i found that on certian IE versions the website look an absolute mess! So i changed everything to absolute to combat this.

    i will let you know how i get on.

    Thanks again.

  5. #5
    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)
    relative positioning
    Relative positioning will rarely be the solution to problems like this. The reason is that relative positioning doesn't actually move anything at all. It only moves things visually but not physically. The element always occupies its original space on the page even though it may look as if it's somewhere else

    Absolute elements are completely removed form the flow and unless they are a fixed height and you can offset the flow then they cannot be cleared to place a footer under multiple absolute elements. It's a shame as it would be useful


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
  •