gpt4 book ai didi

ruby-on-rails - 如何为 simple_form 标签赋予样式?

转载 作者:行者123 更新时间:2023-12-04 13:23:27 30 4
gpt4 key购买 nike

我正在尝试使用 simple_form gem 2.0.2 生成的表单更改字体大小以及输入框和标签之间的间距。我确定有办法做到这一点吗?

目前我有:

<%= f.input :comment, :input_html => { :wrap => :soft, :rows => 2}, :label => 'Type in box below:', :item_wrapper_class => 'type' %>

在我的 css 中:
    .type{
font-size: 24px;
margin-top: 15px;
}

我在本网站上的一篇文章中读到“item_wrapper_class”可以解决问题,但是当我在 Chrome 中检查元素时,通过“在下面的框中键入:”部分,它甚至没有选择 .type 类, 在我的 css 中 - 它只是转到默认标签类,在 bootstrap 中。

任何帮助将不胜感激,谢谢。

最佳答案

这对我有用:

<%= f.input :comment, :input_html => { :wrap => :soft, :rows => 2}, :label => 'Type in box below:', :label_html => { :class => 'type' } %>

关于ruby-on-rails - 如何为 simple_form 标签赋予样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17246368/

30 4 0