0

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.