简体   繁体   English

引导面板未对齐

[英]Bootstrap Panels not Aligned

I'm trying to correctly align multiple columns and rows of Bootstrap Panels. 我正在尝试正确对齐Bootstrap面板的多列和多行。

Sorry if this is a simple question, I'm very new to Bootstrap and fairly new to CSS+HTML. 抱歉,如果这是一个简单的问题,那么我对Bootstrap还是陌生的,对于CSS + HTML还是很陌生的。

Here's the code for one panel; 这是一个面板的代码;

<div class="row">
    <div class="col-sm-3">
        <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">Overall</h3>
            </div>
            <div class="panel-body">
                 Panel Body.
            </div>
        </div>
    </div>

Duplicate this, and we get two side by side. 复制这个,我们得到两个并排。 However, if we add an extra </div> at the end, the next one appears on a new line, but out of alignment. 但是,如果我们在末尾添加一个额外的</div> ,则下一个将出现在新行上,但没有对齐。 I want a similar layout to this; 我想要与此类似的布局;

X X X X
X X X X
X X X X
X X X X

Here's a screenshot of how it looks when out of alignment: http://i.imgur.com/t030kVU.png 以下是屏幕快照在未对齐时的外观: http : //i.imgur.com/t030kVU.png

Thanks for any help you can give, I'm sure it's something simple. 感谢您提供的任何帮助,我敢肯定这很简单。

I don't really see the issue. 我真的没有看到这个问题。 Your markup seems fine to me. 您的加价对我来说似乎不错。 Just put your panels in a new row if you want a new row :) 如果需要新行,只需将面板放到新行:)

<div class="row">
<div class="col-sm-3">
    <div class="panel panel-default">
        <div class="panel-heading">
             <h3 class="panel-title">Overall</h3>
        </div>
        <div class="panel-body">Panel Body.</div>
    </div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
    <div class="panel panel-default">
        <div class="panel-heading">
             <h3 class="panel-title">Overall</h3>
        </div>
        <div class="panel-body">Panel Body.</div>
    </div>
</div>
</div>

See this simple fiddle: http://jsfiddle.net/anup1986/4m0xfzz2/ 看到这个简单的小提琴: http : //jsfiddle.net/anup1986/4m0xfzz2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM