html - 在此 Bootstrap 示例中,调整大小时如何解释对齐方式

标签 html css twitter-bootstrap

我在这个 jsfiddle 中有一个 Bootstrap 表单和一个简单的标签+文本框组合。

<div class="form-group">
    <label class="col-md-4 control-label" for="af_Email">Email</label>
    <div class="col-md-4">
        <input id="af_Email" readonly="readonly" name="af_Email" 
            placeholder="" class="form-control input-md" 
            required="" value="frizzo@hotmail.com" type="email">
    </div>
</div>

当页面展开时(假设在 col-md-* 范围内),标签右对齐,边距很好,页面看起来不错。

enter image description here

当我将页面缩小到小于 col-md-* 时,标签左对齐,面板的边距不存在,看起来不专业:

enter image description here

当页面尺寸小于 col-md-* 时,如何添加边距(在面板的两侧)?

作为奖励问题,有人可以解释在 bootstrap 中定义或记录此行为的位置吗?

最佳答案

看起来你错过了在 .form-group 之前添加 .col-md-12

这是更新:https://jsfiddle.net/ttb0xtn0/1/

关于html - 在此 Bootstrap 示例中,调整大小时如何解释对齐方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42656369/

相关文章:

Javascript 表单验证。使用 onfocus 聚焦输入字段时如何消除错误

html - 最大/最小(宽度和高度)的行为不正常?

javascript - 使用 Casper/Phantom 读取 HTML 属性因环境而异

css - Bootstrap 4 - 如何在卡片右侧 float 一个 div?

javascript - React Bootstrap 无法呈现

twitter-bootstrap - 如何在输入组中实现响应式行为

html - 与按下提交按钮时将信息拉入文本框相比,表单的用途是什么?

javascript - jquery获取突出显示文本的html并更改其样式

html - 标记此示例(内图)。

html - 如何使用 bootstrap3 在移动 View 中以正确的顺序显示 div 表数据?