How do I apply css for textboxes only but not for all the <input> types like CheckBoxes, etc.?
Posted
by George
on Stack Overflow
See other posts from Stack Overflow
or by George
Published on 2010-05-03T15:28:59Z
Indexed on
2010/05/03
16:08 UTC
Read the original article
Hit count: 297
If all browsers supported attribute selectors, we could easily do the following:
input[type='text'] { font:bold 0.8em 'courier new',courier,monospace; }
input[type='radio'] { margin:0 20px; }
input[type='checkbox'] { border:2px solid red;
But I don't think all IE versions of ^ and greater support this.
I think I'd like to avoid skins. Not sure why, other than I tried them and I recall having a negative experience. It was probably my lack of knowledge. Are there any issues in using and CSS, external or otherwise?
What's the best way to handle this? Currently I am assigning separate classes to each control type.
© Stack Overflow or respective owner