问题
At http://ryanspahn.com/adsgrader2/index you can see I have a grey footer and in IE, Safari and Firefox the footer sticks to the bottom. But in Chrome it is not sticking to the bottom - which is odd.
I created this sticky footer using the following method found here on stack ...... CSS to make HTML page footer stay at bottom of the page with a minimum height.
I wonder if anyone has seen this before and or has a suggestion to fix this Chrome issue.
回答1:
I'm not sure about that tutorial but if you want your footer to stay at the bottom you need to use fixed positioning not relative. Fixed means that it will not scroll when the rest of the page scrolls. You can anchor it with the same attributes at absolute positioning using top, bottom, left, right
.
Add the following onto your existing css, and change values where necessary.
#footer {
position: fixed;
bottom: 0px;
width: 100%;
}
#foot {
margin: 0px auto;
}
I also noticed that when you do this you'll have to float the image you have in the footer left.
#right img {
float: left;
}
来源:https://stackoverflow.com/questions/5740512/stick-footer-to-bottom-not-work-in-chrome-does-in-ie-firefox-safari