0
的寬度,我有以下代碼:設置HTML表格TD
<table>
<thead>
<th class='1'>Date</th>
<th class='2'>Start Time</th>
<th class='3'>End Time </th>
<th class='4'>Location</th>
</thead>
<tbody>
<td class='1'>Date</td>
<td class='2'>Start Time</td>
<td class='3'>End Time </td>
<td class='4'>Location</td>
</tbody>
</table>
和CSS
table {width:550px;}
.1 {width:60px; background-color:green;}
.2 {width:90px; background-color:blue;}
.3 {width:90px; background-color:red;}
.4 {width:100px; background-color:yellow;}
爲什麼我不能設置寬度?背景顏色不變,所以我必須有代碼錯誤。
嘗試以字母而不是數字開頭的類名稱。 – 2012-07-23 18:27:01
你不能有一個以數字開頭的類名,請參閱http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names – 2012-07-23 18:27:56
哦,這工作。謝謝。 – user1015214 2012-07-23 18:29:36