[ACCEPTED]-Using CSS to style Ruby objects in erb-css

Accepted answer
Score: 21

You can use the :class option to specify a CSS 2 class:

<%= f.text_field :email, :class => "login" %>

and then put that in your css:

input.login {
  color: red;

Also, you 1 can specify inline CSS if you want:

<%= f.text_field :email, :style => "color: red;" %>
Score: 2

Adding on to what Dylan said...

You can use 2 :id option to specify a CSS id:

<%= image_tag "illustrations/clipboard.png", :id => "clipboard" %>

and then 1 put in your css:

#clipboard {
     border: 1px solid #000;

More Related questions