I am using Twitter bootstrap for Rails/SASS and have notice that it applies a display: block;
style to my labels
,label inputs
and label textareas
.
I am using form tags to generate a check box with a label, but the block style move the two onto different line:
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
My question is two fold. Should I be doing it this way? and if so how best should I override Twitter Bootstraps defaults. I would rather not have lots of !important
flags in my CSS if I can avoid it.
you can do it the bootstrap way and pass in a label block
<%= f.label :remember_me, :class => "checkbox" do %>
<%= f.check_box :remember_me %>remember me
<% end %>
on this way the checkbox also gets checkt if you click on the text. Much nicer!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With