前置输入标签(simple_form + bootstrap-sass)关闭几个像素 [英] Prepended input label (simple_form + bootstrap-sass) off by a few pixels

查看:32
本文介绍了前置输入标签(simple_form + bootstrap-sass)关闭几个像素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用这里看到的文本输入字段:

I want to use the text input field seen here:

http://simple-form-b​​ootstrap.plataformatec.com.br/文章/新

(这是该页面上的第二个文本输入字段.)

(It's the second text input field on that page.)

我在其他 Rails 应用程序中使用了它,但由于某种原因,在我当前的应用程序中,前置标签和文本输入之间存在几个像素的差距.我已经使用 --bootstrap 选项安装了 simple_form,并验证了 Rails/haml/bootstrap/bootstrap-sass 版本与工作中的 Rails 应用程序相同.

I have it working in other Rails apps but for some reason in my current one there is a several-pixel gap between the prepended label and the text input. I've installed simple_form with the --bootstrap option, and have verified that the Rails/haml/bootstrap/bootstrap-sass versions are the same as the working rails app.

我没有在我的样式表中覆盖任何相关的 css(我把它全部注释掉了).

I don't override any of the related css in my stylesheets (I commented it all out to be sure).

有什么想法为什么 Bootstrap 行为不正常?

Any ideas why Bootstrap isn't behaving as it should?

推荐答案

我真的不知道这里的问题是什么,但我有同样的事情.

I don't really know what the problem is here, but I had the same thing.

比较 span.add-on 标签,我发现他们有一个 float: left 标签.我补充说,它似乎奏效了.

Comparing the span.add-on tag I found that they had a float: left on theirs. I added that and it seemed to do the trick.

我还注意到他们正在使用 twitter 2.01.我使用的是 2.02,所以可能会发生一些变化.

I also noticed they are using twitter 2.01. I'm using 2.02, so something might have changed.

这搞砸了追加跨度.

.input-prepend .add-on,
.input-append input {
  float: left;
}

是我添加的.感觉不太对劲,但它现在正在起作用.希望其他更了解引导程序的人可以提供帮助.

Is what I added. It doesn't feel right, but it's working for now. Hopefully someone else more knowledgeable of bootstrap can help out.

这篇关于前置输入标签(simple_form + bootstrap-sass)关闭几个像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆