Page 1 of 1

css input fields

Posted: Thu May 17, 2007 6:59 am
by s.dot
Hello,

I am nearly finished with a client site. He wishes for all input fields that are of type "text" to have a border and a background color.

If I simply make a input { border: ...; background-color: #...; } in the style sheet, it will apply this to submit buttons as well.. which I do not want.

Can I apply css only to the text fields from the style sheet, or would I have to make a class in the stylesheet and manually add class="..." to each individual input text field?

-Scott

Posted: Thu May 17, 2007 7:43 am
by thiscatis
There is solution to define your input only for text in your css, but it doesn't work in IE.
Best way to do it, is to add a class

Posted: Thu May 17, 2007 10:48 am
by matthijs

Code: Select all

input[type="text"] { width: 200px;border:1px solid #ddd; }
Doesn't work in IE6 unfortunately. But we all know what to do with that browser...

Otherwise, as thiscatis mentioned, use a class

Posted: Thu May 17, 2007 11:01 am
by JayBird
Also, background colors on form elements don't work on Mac's FYI

Posted: Fri May 18, 2007 1:27 am
by s.dot
Don't want to get into the whole IE flaming.. but dammit! It would've been so much easier. Manually adding classes to each input field is going to be a doozy.