开发者

Rails simple_form label_html

I'd like to override the margin between the input & its label on one form -- can this be done via :label_html => .... ? The example on github shows a :cla开发者_如何转开发ss => 'special' being passed. Do I need to set up something in my .css file? if so, how would I do that (meaning, do I label it with a ., or a #, or nothing)? The css I've got has a "simple_form label" with some settings, I'm guessing I need to do something similar, but I'm just having difficulty putting the pieces together..

Thanks


Yes. Styling is done in your stylesheet. A selector for your label would be

.simple_form label.special

Because it is placed inside a form with simple_form class, it's tag is label and it's class is special. So you will write something like this in your css file:

.simple_form label.special {
  margin-right: 30px;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜