底部固定
html {
height: 100%;
}
body {
min-height: 100%;
margin: 0;
padding: 0;
position: relative;
}
header {
background-color: #ffe4c4;
}
main {
/*box-sizing: border-box;*/
/*height: 1200px;*/
padding-bottom: 100px;
background-color: #ccc;
}
/* main的padding-bottom值要等于或大于footer的height值 */
footer {
opacity: 0.5;
position: absolute;
bottom: 0;
width: 100%;
height: 100px;
background-color: #ffc0cb;
}
header
content
asdfasdf
asdfasdf
asdfasdf
footer