Greg
Greg

Reputation: 567

pushing a div down to the bottom of the page

I' cant for the life of me figure out why the div "book_button" won't display at the bottom of the page, above the footer. I have a main wrapper div, and then there is a content div. I've placed the book_button in a relative position outside the content div. In the dream weaver design window it's showing it where I want it to be. When I view it in a browser it diplays like so

http://kerrydean.ca/GreyRiver/fly_fishing.html

here is the css

#Wrapper {
    margin-top:0;
    margin-right: auto;
    margin-left: auto;
    position: relative;
    background-color: #ebebeb;
    padding: 0px;
    width: 100%;
    top: 75px;
}
#Header {
    background-color: #b2b85c;
    height: 75px;
    width: 100%;
    position: fixed;
    top: 0px;
    overflow: hidden;
    z-index: 999;
    border-bottom-width: 3px;
    border-bottom-style: solid;
    border-bottom-color: #FFF;
}
#Content {
    width: 900px;
    position: relative;
    margin-right: auto;
    margin-left: auto;
}
#Left_Side {
    padding: 10px;
    width: 485px;
    clear: left;
    float: left;
}
#Right_Side {
    width: 340px;
    position: relative;
    display: inline;
    float: right;
    margin-left: 20px;
    margin-bottom: 10px;
    padding-left: 35px;
    height: 100%;
}
#Footer {
    background-color: #BCC271;
    height: 15px;
    width: 100%;
    text-align: center;
    padding-top: 15px;
    padding-bottom: 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #FFF;
    float: left;
    position: relative;
}
/* Navigation*/
.nav-wrap {
    position: relative;
    margin-right: auto;
    margin-left: auto;
    width: 900px;
    padding-left: 15px;
    padding-top: 31px;
}
ul#navlist
{
    margin-left: 0;
    padding-left: 0;
    white-space: nowrap;
}

#navlist li
{
    display: inline;
    list-style-type: none;
}

#navlist a {
    font-family: "Times New Roman", Times, serif;
    font-size: 18px;
    padding-top: 3px;
    padding-right: 20px;
    padding-bottom: 8px;
    padding-left: 20px;
}

#navlist a:link, #navlist a:visited
{
    color: #fff;
    background-color: #b2b85c;
    text-decoration: none;
    border-left-width: 1px;
    border-left-style: dotted;
    border-left-color: #FFF;
}

#navlist a:hover
{
    color: #fff;
    background-color: #b2b85c;
    text-decoration: none;
    background-image: url(../GreyRiver/Images/pointer.jpg);
    background-repeat: no-repeat;
    background-position: 50% bottom;
}
.border-none{
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;    
    }
/*End of Navigation*/
#header_img{
    height: 250px;
    width: 900px;
    position: relative;
    background-image: url(../GreyRiver/Images/Fly_fishing_header.jpg);
    margin-top: 10px;
    margin-bottom: 25px;
}
#book_button{
    position: relative;
    margin-top: 0px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    text-align: center;
}

I figured it out.

I put the book_button div right before the footer. I made the width 100%, position:relative and add a float:left

thanks anyway!

Upvotes: 0

Views: 932

Answers (3)

Boone
Boone

Reputation: 1056

I took your current view source and just changed the #book_button back to relative and it displays in between the footer and the content. Change that back to relative as absolute will not work.

Upvotes: 0

Ian
Ian

Reputation: 3836

This probably isn't best practice, but you could use the top style property to push the button down where you want it. It looks like the content of your page is static, meaning that button isn't going to need to position itself dynamically each time the page loads. So, a hard coded value to position it may work for you.

Upvotes: 0

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114417

1) Make #Wrapper position:relative

2) make #book_button position:absolute, set bottom:40px;right:200px;

Upvotes: 1

Related Questions