faqts : Computers : Internet : Web : CSS : Styling FORM Elements

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 5 people (80%) answered Yes
Recently 4 of 5 people (80%) answered Yes

Entry

is it possible to declare a style for INPUT elements but a different one for checkboxes?

Oct 7th, 2004 08:50
Ben Gordon, Jenö Groller, jsWalter,


Yes it is possible, presently it can be done by using classes 
something like this
<style type="text/css">
/*<![CDATA[*/
<!--
input {background-color: red;}
.different {background-color: blue;}
-->
/*]]>*/
</style>
then your HTML would be something like 
<form action="">
<input type="text" />
<input type="checkbox" class="different" />
</form>
when the CSS level 3 becomes the standard it will become as simple as 
input[type=checkbox] {your properties}
Caislander
webxpertz.net/forums