开发者

Rails simple_form label_html

开发者 https://www.devze.com 2023-03-13 13:32 出处:网络
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 p

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

精彩评论

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