Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

css for input boxes

Status
Not open for further replies.

dakota81

Technical User
May 15, 2001
1,691
US
Can I create separate css properties in the head of a .html file for the different types of input boxes? In other words, I can type this:

input {color:black;}

and all input tags now display black text. Does css allow me to specify instead properties for just text boxes, just buttons, just radio buttons?
 
Unfortunately, attribute selectors are not widely supportable yet. Some day. For now, I suggest setting up classes, as follows:

Code:
.black {
    color: #000;
}

.red {
    color: red;
}

And then applying them to any field you'd like to take this appearance:

Code:
<input type="text" class="black" />
<input type="radio" class="black" />
<input type="checkbox" class="red" />

*cLFlaVA
----------------------------
"Holy crip he's a crapple!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top