Доброго дня.
Выполнил последнее задание, вышло 100%. Но я думаю, что я нагрузил очень сильно CSS. Что из этого можно упростить и убрать, подскажите пожалуйста? Кусок html в конце.
CSS:
body {
width: 350px;
margin: 0;
padding: 0 10px;
font-size: 14px;
font-family: Arial, sans-serif;
}
.class-1 {
border-top: 1px solid black;
border-bottom: 1px solid black;
color: white;
padding: 10px;
background-color: darkcyan;
text-align: left;
}
.class-2 {
border-top: 1px solid black;
border-bottom: 1px solid black;
color: white;
padding: 10px;
background-color: lightblue;
text-align: center;
}
.class-3 {
border-top: 1px solid black;
border-bottom: 1px solid black;
color: white;
padding: 10px;
background-color: darkcyan;
text-align: right;
}
.class-4 {
background-color: white;
text-align: left;
}
.class-5 {
background-color: white;
text-align: center;
}
.class-6 {
background-color: white;
text-align: right;
}
.class-7 {
background-color: lightyellow;
text-align: left;
}
.class-8 {
background-color: lightyellow;
text-align: center;
}
.class-9 {
background-color: lightyellow;
text-align: right;
}
table {
border-collapse: collapse;
}
td {
width: 33%;
padding: 10px;
color: black;
border-bottom: 1px solid lightgray;
}
Кусок html:
> <h1>Итоговая таблица</h1>
> <table>
> <tr>
> <th class="class-1">Город</th>
> <th class="class-2">Посещений</th>
> <th class="class-3">%</th>
> </tr>
> <tr>
> <td class="class-4">СПб</td>
> <td class="class-5">199</td>
> <td class="class-6">65.12</td>
> </tr>
> <tr>
> <td class="class-7">Москва</td>
> <td class="class-8">69</td>
> <td class="class-9">21.3</td>
> </tr>
> <tr>
> <td class="class-4">Киев</td>
> <td class="class-5">5</td>
> <td class="class-6">8</td>
> </tr>
> <tr>
> <td class="class-7" colspan="2">Посещений за весь период</td>
> <td class="class-9">273</td>
> </tr>