css - Bootstrap 验证消息正在下推我的表单的其余部分

标签 css angularjs twitter-bootstrap-3 angular-ui-bootstrap

我在 CodePen 中创建了一个简单的表单. name 字段上的 required 验证工作得很好。但是,我想在两个字段之间添加一些填充,当错误消息应该显示时...填充该空白(意思是,错误消息出现的下面的字段不会被下推)。相反,它会不断下推字段以为错误腾出空间。修复错误后,该字段将被拉回。

我想要这样的东西:

enter image description here

enter image description here

我已经尝试设置 .errorMessage 的位置,但这没有任何改变。

.errorMessage{
        position: relative;
        //position: absolute;  <--I've tried this, too
    }

我做错了什么?

最佳答案

查看此代码笔:http://codepen.io/Sky-123/pen/QKoLEz

在 css 中做了轻微的变通:

div.form-group{
  margin-bottom:35px
}

div.has-error{
 height:0px 
} 

关于css - Bootstrap 验证消息正在下推我的表单的其余部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40223254/

相关文章:

css - 将::选择伪 CSS 恢复为默认值

javascript - 更改另一个 DIV 之前的 DIV 宽度

angularjs - AngularJS HTTP 中的模拟服务

javascript - ng-cloak 指令被过早删除

javascript - AngularJS 在路由更改之前确认

html - 强制段落高度相同

javascript - 如何在不影响移动版 javascript 的情况下使我的导航栏居中

html - 根据浏览器更改 DIV 的属性

html - css 和 html 中的 3x3 表格每一面都有不同的颜色

html - 使用 Bootstrap 登录表单