Witam. Swego czasu również szukałem odpowiedzi na to pytanie i jak dla mnie najlepszym rozwiązaniem okazało się to: CSS Sticky Footer, Footer Stick to Bottom of Page
Co oznacza w twoim kodzie
float: center; (nie ma takiej wartosci)
position: relative; (w jakim celu)
height: 170;( gdzie jednostka)
margin-top:10;
float:left; (przecież nie ustawiasz elementów obok siebie)
Zaraz dostaniesz kultowe pytanie dlaczego stylizujesz po id.
Dlaczego mieszasz (niewłaściwie) % z px.
Twój kod:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
*{
box-sizing:border-box;
margin: 0;
}
html,body {
margin:0;
padding:0;
height: 100%;
}
body
{
background-color: #2e83d4;
color: white;
text-align: center;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -4em;
}
.header{
background:#ACACAC;
}
.center_c{
width:80%;
background:#ACACAC;
margin:1% 10%;
}
.center_d{
width:80%;
background:#ACACAC;
margin:1% 10%;
}
.footer{
background:#ACACAC;
}
.footer, .push {
height: 4em;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="header">HEADER</div>
<div class="center_c">CENTER C</div>
<div class="center_d">CENTER D</div>
<div class="push"></div>
</div>
<div class="footer">FOOTER</div>
</body>
</html>