inherit
88478
0
Nov 28, 2024 17:05:24 GMT -8
Robyn
22,567
September 2006
millsberryfanrob
|
Post by Robyn on Mar 19, 2011 14:07:01 GMT -8
I am nearly finished with my web design. The last problem I'm facing is trying to get my footer image to be at the bottom of the page. Not the bottom of the browser window, or bottom of the content. Like if the content is longer than a page, then I want it to be below the content. newwebsite.robertcity.com - My website matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page - The site I'm basing the footer thing off of. Nick/Darkmage is unable to help out, so what's wrong?
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 19, 2011 19:17:02 GMT -8
Remove the red so it flows.
#footer { bottom:0; height:178px; /* Height of the footer */ width:100%; position:absolute; background-image: url("./images/bottom-bg.png");
}
You also need to remove the fixed height because it's causing the text to overflow out of the element. Instead, you shouldn't define a height and just let the content flow naturally. However, if you do want it to be a fixed height, then you should set the overflow property to auto.
#table { background-image: url("./images/middle-bg.png"); width: 1000px; height: 146px; margin-left: auto; margin-right: auto; background-position:center;
}
|
|
inherit
88478
0
Nov 28, 2024 17:05:24 GMT -8
Robyn
22,567
September 2006
millsberryfanrob
|
Post by Robyn on Mar 20, 2011 12:39:34 GMT -8
Did so and it still won't "work."
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 20, 2011 12:46:09 GMT -8
What is it that you want to change? The footer is now positioned below your content, although I would recommend removing some of that space.
Edit: Be sure to hard refresh after you update external files so your browser reloads them rather than using the cached files on your local hard drive. I had to press CTRL F5 for the changes to take effect on your website.
|
|
inherit
88478
0
Nov 28, 2024 17:05:24 GMT -8
Robyn
22,567
September 2006
millsberryfanrob
|
Post by Robyn on Mar 20, 2011 12:58:39 GMT -8
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 20, 2011 13:03:28 GMT -8
Five minutes ago your website looked different so I guess you were working on it, but as I said earlier you must remove the red. Just think about what it's doing. Also, if you don't want the background image to repeat all the way down, add the blue.
#table { background-image: url("./images/middle-bg.png"); width: 1000px; height: 150px; margin-left: auto; margin-right: auto; background-position: top center; background-repeat: no-repeat;
}
The reason the red text is making the footer appear to be in the wrong place (even though it's really in the correct place when the element has a height of 150px) is because when you give the element a fixed height, the browser forces it to be that height, even if the text overflows out of the element which it is in your case so it appears to be taller than 150px since you don't have a border. However, since it's really only 150px, the footer is positioned directly under that element. All of that text is just overflowing out of the element so it looks all wrong.
|
|
inherit
88478
0
Nov 28, 2024 17:05:24 GMT -8
Robyn
22,567
September 2006
millsberryfanrob
|
Post by Robyn on Mar 20, 2011 13:19:18 GMT -8
I think it's working now. Can you check and see?
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 20, 2011 13:20:37 GMT -8
Yep, looks good to me.
|
|
inherit
88478
0
Nov 28, 2024 17:05:24 GMT -8
Robyn
22,567
September 2006
millsberryfanrob
|
Post by Robyn on Mar 20, 2011 13:22:15 GMT -8
Awesome. Thanks! BTW what do you think about the accuracy of the blog post I posted with the guy explaining how to force the image on the bottom?
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 20, 2011 13:30:53 GMT -8
He knows what he is talking about so it's a good informative post. The problem was that you added that fixed height.
By the way, I realized you'll actually want to add the red back in. The real culprit was the fixed height that I explained above, and it's fine to have it absolutely positioned since the parent container element is relatively positioned which I forgot to check for initially.
#footer { height:178px; /* Height of the footer */ width:100%; position:absolute; bottom:0; background-image: url("http://newwebsite.robertcity.com/images/bottom-bg.png");
}
|
|
inherit
88478
0
Nov 28, 2024 17:05:24 GMT -8
Robyn
22,567
September 2006
millsberryfanrob
|
Post by Robyn on Mar 20, 2011 13:35:14 GMT -8
It's find now actually. The footer does what I want, so I don't need to add the red back in.
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 20, 2011 13:38:42 GMT -8
It should be fine when you have a lot of content like you do now, but if the page is short it may not float to the bottom of the browser window. I would recommend testing it, but glad it's working for you now. "... The div is absolutely positioned bottom:0; this moves it to the bottom of the container div. When there is little content on the page the container div is exactly the height of the browser viewport (because of the min-height:100% and the footer sits neatly at the bottom of the screen. When there is more than a page of content the container div becomes larger and extends down below the bottom of the viewport - the footer is still positioned at the bottom of the container div but this time you need to scroll down to the end of the page to see it. The footer is also set to width:100%; so it stretches across the whole page."
|
|
inherit
88478
0
Nov 28, 2024 17:05:24 GMT -8
Robyn
22,567
September 2006
millsberryfanrob
|
Post by Robyn on Mar 20, 2011 13:47:05 GMT -8
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Mar 20, 2011 18:33:19 GMT -8
Add the red.
#body { padding:10px 10px; padding-bottom:178px; }
|
|
inherit
88478
0
Nov 28, 2024 17:05:24 GMT -8
Robyn
22,567
September 2006
millsberryfanrob
|
Post by Robyn on Mar 21, 2011 14:56:06 GMT -8
Excellent. And it works with each browser. Only thing is, can you view it in IE 7 or 8? Do you notice the header color difference (the difference in color contrast between the logo and the background logo?)
|
|