SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru D-flyer's Avatar
    Join Date
    Jan 2001
    Location
    Near a computer
    Posts
    782
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    i position the footer a fix ("vertical") distance from mainContent.

    Hi there,

    I am trying to use css to layout a website.

    right now i have:

    PHP Code:
    <style type="text/css">
    #header {
     
    position:absolute;
     
    left0px;
     
    top0px;
     
    width100%;
    }
    #flashContent {
     
    position:absolute;
     
    left0px;
     
    top50px;
     
    width100%;
    }
    #mainContent {
     
    position:absolute;
     
    left:0px
     top
    250;
     
    width100%;
    }
    #footer {
     
    position:absolute;
     
    left0px;
     
    top550px;
     
    width100%;
    }
    </
    style
    How can i position the footer a fix ("vertical") distance from mainContent. Because mainContent will difer from page to page.

    any tips

  2. #2
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I assume that all of these are appied to divs. Since divs are 100% width by default (I believe) replace what you have there with

    HTML Code:
    <style type="text/css">
    #header {
    }
    #flashContent {
    }
    #mainContent {
    }
    #footer {
      margin-top: 20px;
    }
    </style> 
    The divs will have to appear in order in the HTML mark-up though. You may also wish to add other margins to space your divs ( don't know how tall they where so I can't tell how much space was between them from their position offsets.

  3. #3
    SitePoint Guru D-flyer's Avatar
    Join Date
    Jan 2001
    Location
    Near a computer
    Posts
    782
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I assume that all of these are appied to divs.
    If i understand you correctly my amswer is yes. I am trying to use nested div's. Those four #... are for the general layout.

    Furthermore i use php's include function. The page i include have there own css.

    btw your suggestion margin-top: 20px doesn't take #mainContent as his starting point. Any other tips??

  4. #4
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Without knowing the exact layout you are after is is hard for me to give precise values, I assume that you know px are pixels. Adjust the values of margin-top and margin-bottom (defaults are 0px) so that you get the layout spacing you require.

    It is hard for me to be any more specific without a better idea of what you already have and where you would like to end up. Try posting a link to you pages (preferably) or posting the entire text of your css and html.


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
  •