I am using form_for in rails to create a user form to sign-in. I am not using bootstrap to format the form. I would like to change the size of the text field box in the form. Can any suggest me with the css code of that?
2 Answers
You would use something like this if you want to edit all the input-text elements.
form input[type='text'] {
width: 100px;
height: 30px;
}
Else you also could use
#user_email {
your styling;
}
Or, you also can attach a custom class to your text field via
f.text_field :email, :class => 'login-email-field'
Comments
Well, maybe you could try something like:
In ruby:
<%= form_for @client do |f| %>
<%= f.text_field :request, class: "client-request" %>
<%= f.submit %>
<% end %>
In CSS:
.client-request {
width: 300px;
height: 60px;
}
What about?
2 Comments
Chris Peters
Your CSS would only work with this:
<%= f.text_field :request, class: "client-request" %>.Chris Peters
Unless you meant this for the CSS:
#client_request { ... }. I probably wouldn't do that in case that id gets used elsewhere though.