0

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 2

3

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'
Sign up to request clarification or add additional context in comments.

Comments

0

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

Your CSS would only work with this: <%= f.text_field :request, class: "client-request" %>.
Unless you meant this for the CSS: #client_request { ... }. I probably wouldn't do that in case that id gets used elsewhere though.

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.