chip
chip

Reputation: 21

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 :class => '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

Upvotes: 2

Views: 2326

Answers (1)

Simon Perepelitsa
Simon Perepelitsa

Reputation: 20649

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;
}

Upvotes: 3

Related Questions