Apr
CSS Classes to input tags
Filed Under (CSS) by khawaib on 06-04-2010
Tagged Under : button, classes, CSS, css classes, different widths, elements, input, input tags, tags
Input elements can be targeted by assigning tags to the same input types. It is possible that we want to style input elements as text input fields, text areas and select boxes to have different widths while button input elements to have a different style.
<input type="text" class="text" /> <input type="checkbox" class="checkbox" /> <input type="radio" class="radio" /> <input type="button" class="button" />
Can also use multiple classes:
<input type="password" class="password text" />
Now using following in css we can target each type separately.
input[type="button"] { border:2px solid #ccc; padding:3px}
