Sowjanya
Sowjanya

Reputation: 11

CSS code while using form_for in rails to modify the textfield size

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?

Upvotes: 0

Views: 2551

Answers (2)

Alvaro Lourenço
Alvaro Lourenço

Reputation: 1341

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?

Upvotes: 0

Martin Lang
Martin Lang

Reputation: 831

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'

Upvotes: 3

Related Questions