gpt4 book ai didi

html - Rails field_with_errors 和 Bootstrap form-horizo​​ntal

转载 作者:太空狗 更新时间:2023-10-29 12:27:42 24 4
gpt4 key购买 nike

在我的 custom.css.scss 文件中,我有:

.field_with_errors {
@extend .control-group;
@extend .error;
}

问题是对于 Bootstrap 水平表单,字段不会保持对齐。

HTML(由 Rails 生成)是:

<div class="control-group">
<div class="field_with_errors"><label class="control-label" for="bookmark_url">Url</label></div>
<div class="controls">
<div class="field_with_errors"><input id="bookmark_url" name="bookmark[url]" size="30" type="text" value=""></div>
</div>
</div>

Here is a jsfiddle来说明问题。

有人知道如何解决这个问题吗?

最佳答案

我用下面的 CSS 修复了它:

.form-horizontal .field_with_errors
{
margin: 0;
}

.form-horizontal .field_with_errors:before, .form-horizontal .field_with_errors::after
{
display: block;
clear: none;
}

关于html - Rails field_with_errors 和 Bootstrap form-horizo​​ntal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13511770/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com