方法之一:
.parent{
padding: ;
}
.child{
margin: 0 auto;
display: block;
width: ;
height: ;
}
- footer置底
1.Have a
<div>
with class="wrapper" for your content 2。Right before the closing of the wrapper place the<div class="push"></div>
3.Right after the closing of the wrapper place the<div class="footer"></div>
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
height: 142px; /* .push must be the same height as .footer */
}