I'm experimenting with using percentages instead of pixels and noticing some unusual behavior. Why is my footer extending to the right (beyond the "pagePlaceHolderInner" element)? It works when I assign a specific pixel value to both elements ("pagePlaceHolderInner" and "footer"), but I prefer to use percentages in this case.
Here's the code:
<html>
<head>
<style type="text/css">
body #pagePlaceHolderOuter {
background: #FFFFFF;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
body #pagePlaceHolderOuter #pagePlaceHolderInner {
background: none repeat scroll 0 0 yellow;
height: 100%;
margin: 0 auto;
max-width: 1000px;
min-width: 700px;
width: 70%;
}
body #pagePlaceHolderOuter #pagePlaceHolderInner .footer {
background: gray;
bottom: 0;
height: 20%;
position: fixed;
width: 100%;
}
</style>
</head>
<body>
<div id="pagePlaceHolderOuter">
<div id="pagePlaceHolderInner">
<h1>Hello everyone!</h1>
<div class="footer"></div>
</div>
</div>
</body>
</html>
View this on jsfiddle