J'ai le code suivant:
<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>
et le 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;}
Pourquoi ne puis-je pas définir la largeur? La couleur de fond ne change pas non plus et je dois donc avoir une erreur de code.
Réponses:
2 pour la réponse № 1Les noms de classe ne peuvent pas commencer par des chiffres. Essayez de renommer vos classes pour commencer une lettre (a-z).
JS Fiddle: http://jsfiddle.net/sDKp2/