📜  将页脚保留在页面底部 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:28.342000             🧑  作者: Mango

代码示例2
#footer {
  position: relative;
  margin-top: -180px;
  /* negative value of footer height */
  height: 180px;
  clear: both;
 /*Custom styling*/
}

/* Opera Fix thanks to Maleika (Kohoutec) */

body:before {
  content: "";
  height: 100%;
  float: left;
  width: 0;
  margin-top: -32767px;
  /* thank you Erik J - negate effect of float*/
}