css - 填充问题 - bootstrap 3

标签 css twitter-bootstrap twitter-bootstrap-3

Mobile 模式下查看下面的示例。

Sample

Fieldset 3 中,为什么所有标签和文本框的左侧都有轻微的 padding

最佳答案

像下面的回答状态一样,您已经为 Fieldset 3 提供了 col-md-6 类以及您的 form-group。现在,由于您确实需要 col-md-6 将元素分成 2 列,您可以针对特定的字段集并删除填充。

HTML:

 <form class="form-horizontal" id="fieldset3"> <!-- ID added -->
            <fieldset>
                <legend>Fieldset 3</legend>

CSS:

#fieldset3 .col-md-6{
  padding-left:0px;
}

DEMO 1

为了方便起见,您还可以这样对标签进行分组:

<div class="col-md-6">
    <div class="form-group">
        <!-- Label and input here -->
    </div>
    <div class="form-group">
        <!-- Label and input here -->
    </div>
    <div class="form-group">
        <!-- Label and input here -->
    </div>
</div>

<div class="col-md-6">
    <div class="form-group">
        <!-- Label and input here -->
    </div>
    <div class="form-group">
        <!-- Label and input here -->
    </div>
    <div class="form-group">
        <!-- Label and input here -->
    </div>
</div>

DEMO 2

关于css - 填充问题 - bootstrap 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24227601/

相关文章:

javascript - CSS 对齐问题

html - Bootstrap : change order of fullwidth columns on mobile devices

css - 将 ValidationSummary MVC3 显示为 "alert-error"Bootstrap

html - 扩展 Bootstrap 移动导航

javascript - 单击菜单在 <div> 中打开 pdf

css - 如何在包含复选框的 div 上设置边框?

javascript - 如何控制div的水平滚动?

jquery 简单轮播动画前一个元素移动

css - Bootstrap 3 : Can the Glyphicons be stacked like Font Awesome's icons?

html - 为什么 div 居中而不链接?