Is it possible to define css style for checkbox in a form without define id and class for it? I know i can use
input {css...}
but i will effect all the inputs in the form.
Like this, using attribute selectors:
input[type="checkbox"] {
css...
}
Just be aware that IE6 does not support this. Apart from that, browser support is pretty good.
In addition to attribute selectors, you can, in some newer browsers, use several different pseudo-classes, for example:
<form>
<input type="text" />
<input type="text" />
<input type="text" />
</form>
to target the second input:
input:nth-child(n) {
css-property: value;
}