Mel
Mel

Reputation: 2687

CSS styling on Simple Form in Rails Bootstrap

Does anyone know how to put CSS styling on labels in Simple Form with Rails Bootstrap (SCSS)?

I have this line in my form. I can't find a way to style the label.

I have a css div class defined as 'question-project', but I can't find a way to get the form to pick it up.

    <%= f.input :project_title, label: 'Project Title', placeholder: 'A catchy, relevant title for your project', :input_html => {:style=> 'width: 650px', class: 'response-project'} %>

If I put a div tag around the entire <%= %> then it overrides the styling inside the field.

Thank you

Upvotes: 0

Views: 1556

Answers (1)

Mel
Mel

Reputation: 2687

After a day of searching, I found the answer. I hope this helps others who don't understand how to work with these tools intuitively.

<%= f.input :project_title, label: 'Project Title', :label_html => { :class => 'question-project' }, placeholder: 'A catchy, relevant title for your project', :input_html => {:style=> 'width: 650px', class: 'response-project'} %>

^ You can see above that there is a :label_html field and an :input_html field.

Upvotes: 1

Related Questions