input框的預設bug是在沒幹掉邊框的情況下是不能設定背景顏色的,否則邊框會變成內邊框(黑色)效果,很難看。

解決辦法是:

none掉input框的邊框:border:none;

再設定其背景色為任何顏色就沒問題了。

但是,此時你要是想給這個input框一個看上去的邊框怎麼辦,因為none掉了,所以解決辦法是:

在input框的外層加個div來產生邊框效果,input被包含在內只用改變其背景即可。寫法如下:

<td colspan="3" class="t_content">
      <div class="t_control">
          <input type="text" />
       </div>
 </td>

.t_control{
    border: 1px solid #c9cccc;//邊框效果只能由div來實現
    height: 28px;
    width: 98.7%;
}
.t_control input{
    border: none;//只有幹掉邊框才能設定input的背景色background
    height: 26px;
    width: 99%;
    padding-left: 5px;
    background: #fff;
}