第一种:
.style1{color:red;}
.style2{color:green;}
<input type=”text” class=”style1″ />
<input type=”password” class=”style2″ />
第二种:
<input type=”text” />
<input type=”password” />
第三种:css3选择器,ie低版本不支持
input[type=text]{color:red;}
input[type=password]{color:green;}
<input type=”text” />
<input type=”password” />
当然还可以根据js去做