我正在處理一個示例,我必須將按鈕組對齊到右側。我發現了css類.pull-right
。 正確地移動按鈕組時,我無法重置下一部分。 我已經在多個對象上使用了clearfix混搭,我無法清除section
與按鈕組相交的方式。引導程序的右移沒有清除或重置
上bootply將樣品(以下鏈接):
<div class="container foo">
<div class="btn-group pull-right" role="group">
<button type="button" class="btn btn-default">Left</button>
<button type="button" class="btn btn-default">Middle</button>
<button type="button" class="btn btn-default">Right</button>
</div>
<section class="debug text-center">
<h1>Bootstrap starter template</h1>
<p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.</p>
</section>
</div>
而且
.foo
{
.clearfix();
}
.foo::before,
.foo::after {
content: " "; // 1
display: table; // 2
}
.foo::after {
clear: both;
}
由於缺少少混入載體I手動實現了混入
在這裏,CSS是一種可運行示例:http://www.bootply.com/8GgDsWc8kZ
我一直在谷歌搜索這和我pu t foo到那裏的每一個div,沒有地方清除了相交的部分。
任何提示讚賞。