0
<div class="row">
    <div class="span4">
        <h2>Cele mai vandute</h2>
    </div>
    <div class="span10 offset1 well">
        <ul class="thumbnails">
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
            <li class="span2">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </li>
        </ul>
    </div>
</div>

您好,我在引导 css 将这个跨度集中在容器类中时遇到了麻烦。有人可以向我解释一下 bootstrap 中的居中如何特别适用于跨度。非常感谢您

4

2 回答 2

1

您已在引导站点中对其进行了解释。

通常,您span的 s 总和可能为 12(直到您自定义它)。

此外,您正在使用<li>elements 而不是<div>,这是 bootstrap 用于网格的元素

对您的代码进行一些调整:

<div class="row">
    <div class="span2">
        <h2>Cele mai vandute</h2>
    </div>
    <div class="span10">
        <div class="row">
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
            <div class="span1">
                <a href="#" class="thumbnail"><img data-src="holder.js/200x100" alt=""></a>
            </div>
        </div>
    </div>
</div>
于 2013-01-10T12:37:47.660 回答
0

我使用 ul 和 li 而不是 div,因为在 bootstrap 网站上的示例中它显示 ul 和 li .. 不是每行 div 我总共可以有 12 个,之后我需要再次在另一行上工作,最多12?像这样:

<div class="row">
<span class="9">...</div>
<span class="3">...</div>
</div>
<div class="row">
<span class="9">...</div>
<span class="3">...</div>
于 2013-01-10T13:52:45.237 回答