css 清除修复

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 清除修复相关的知识,希望对你有一定的参考价值。

/*
この3つのうちのどれでも良い。
*/

.clearfix:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

/* ------------------------------------------------------ */

.clearfix {
	width:100%;
}
.clearfix:after {
    content: ""; 
    display: block; 
    clear: both;
} 
html[xmlns] .clearfix {
	display: block;
}
* html .clearfix {
	height: 1%;
}

/* ------------------------------------------------------ */

.clearfix:after {
	content:".";
	display:block;
	height:0;
	clear:both;
	visibility:hidden;
}
.clearfix {display:inline-block;}
/* Hide from IE Mac \*/
	.clearfix {display:block;}
/* End hide from IE Mac */
/**
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    contenteditable attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that are clearfixed.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}

/**
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */
.clearfix {
    *zoom: 1;
}

以上是关于css 清除修复的主要内容,如果未能解决你的问题,请参考以下文章

css 清除修复

css 清除浮动修复以适合父级

css 清除修复

css 哈克清除修复容器

CSS 清除修复

CSS 清除修复