我有IE7问题和清理漂浮在本页面:IE7 cleafix不工作
https://dev.editionpatrickfrey.com/de/books/miss-martin-guggisberg
我使用的是萨斯饼clearfix();混入,并尝试所有可能的其他clearfixes没有成功。这里有什么问题?
我有IE7问题和清理漂浮在本页面:IE7 cleafix不工作
https://dev.editionpatrickfrey.com/de/books/miss-martin-guggisberg
我使用的是萨斯饼clearfix();混入,并尝试所有可能的其他clearfixes没有成功。这里有什么问题?
我意识到我需要一个包装容器去做这个。我只是想在一个层次上清除浮动元素。使用Sass pie-clearfix()添加容器; mixin解决了这个问题。
下面的ClearFix可能会应用于浮动子元素的父元素,或作为浮动元素下面的元素应用。这应该涵盖IE6 - IE10。
.clear:before,
.clear:after {
content: "";
display: table;
}
.clear:after {
clear: both;
}
.clear {
zoom: 1; /* For IE 6/7 (trigger hasLayout) */
}
我个人使用这个ClearFix,但要找出更多有关此ClearFix,看看这个链接:http://css-tricks.com/snippets/css/clear-fix/
希望这有助于!
您需要的floatstop添加到包含浮动元素的父元素:
CSS:
.floatstop:after {
content: ".";
display :block;
height :0;
clear :both;
visibility :hidden;
}
*:first-child+html .floatstop {min-height: 1px;}/* ie7 fix */
* html .floatstop {height: 1%;}/* ie6 fix */
HTML:
<div class="floatstop">
<div>floated div</div>
<div>floated div</div>
</div>