Topic: Styling text fields only

Is there any simple way to style input fields of type "text" only (not buttons and other input elements) without applying a class to them "manually". Or is there any way using Rails to apply a class to all text_fields?

Re: Styling text fields only

input[type=text] {
  width: 400px;
}

works in Firefox but not IE, I don't know about other browsers.

Re: Styling text fields only

... or is there any simple way using for example Prototype to read in all <input> elements and apply a class when a page loads?

Re: Styling text fields only

ok, here is how I solved it anyway, maybe there is a simpler way I don't know...

    function labelTextInputFields() {
        elements = $$('input[type=text]');
        elements.each( function(element) {
            element.addClassName('text-input');
        });
    }
    //
    window.onload = labelTextInputFields;

... then I can style text-fields with:

input.text-input {
     width: 200px;
}