Reputation: 2908
I have a form_for in my rails app. I just figured out how to override bootstrap css on input text fields. but I dont know how to override the css on input text area
Okay so this is how I change the natural styling of my text field.
CSS
.product-form input[type="text"] {
height: 26px;
border: 0px ;
}
Haml form_for
%span.product-form
= f.text_field :name, placeholder: "Name"
However this doesn't work on text area = f.text_area :description
Any ideas?
Upvotes: 1
Views: 872
Reputation:
A textarea tag is a separate type of tag from an input tag with type text. You'll need to style the textarea separately. If you want the same styling as your input field, you can just add it:
.product-form input[type="text"], .product-form textarea {
height: 26px;
border: 0px ;
}
You might not want to style textareas the same as text inputs, though, as the elements do function differently.
One thing to get used to, when doing CSS work, is using the developer tools provided by your browser to troubleshoot problems like this. When you're trying to style an element and it isn't taking, right click that element and click 'Inspect Element' (assuming Firefox or Chrome), which will help you figure out answers to these kind of questions yourself.
Upvotes: 2