Для 100% соответствия пришлось добавлять margin’ы, не кратные 5 + дописывать класс для установки цифры 5 с помощью абсолютного позиционирования. По условию заданию все отступы и шрифты д.б. кратны 5, код html трогать нельзя. Как соблюсти условия.
Мое решение:
<body> <div class="post"> <div class="post-title">Интенсив: программа</div> <div class="post-date">13.09</div> <div class="post-type"></div> <div class="post-author"> Автор: <a href="#">HTML Academy</a> </div> <div class="post-stats"> <div class="icon icon-tags"></div> <a href="#">интенсив</a>, <a href="#">программа</a> </div> <div class="post-stats five"> <div class="icon icon-comments"></div> <a href="#">5</a> </div> <div class="post-text">Работа над интенсивом идёт полным ходом. Мы нашли крутых людей в команду и решили еще кучу задач. Но сегодня я подробнее расскажу о работе над программой интенсива.</div> </div> </body>
CSS:
html,
body {
margin: 0;
padding: 0;
}
body {
width: 280px;
min-height: 250px;
padding-top: 50px;
padding-left: 10px;
padding-right: 10px;
font-size: 12px;
font-family: “Arial”, sans-serif;
line-height: 1.2;
color: #7f8c8d;
background: #ecf0f1;
}
.post {
margin:0;
padding:0;
}
.post-stats .icon {
width: 15px;
height: 15px;
}
.post-date {
background-color: #ffffff;
height: 55px;
width: 55px;
line-height: 55px;
color: #7f8c8d;
font-weight: bold;
font-size: 15px;
vertical-align: middle;
text-align: center;
border-bottom: 5px solid #bdc3c7;
margin-bottom: 10px;}
.post-type {
height: 55px;
width: 55px;
border-bottom: 5px solid #bdc3c7;
background: #7f8c8d url("/assets/course14/quotes.png") no-repeat 50% 50%;
}
.post-title {
position: absolute;
top: 50px;
left: 85px;
font-size: 20px;
color: #2980b9;}
.post-author {
color: #7f8c8d;
position: absolute;
left: 85px;
top: 80px;
margin-top: -1px;
}
.post-author a {
color: #2980b9;
text-decoration: none;
}
.post-stats {
position: absolute;
left: 105px;
top: 85px;
margin-top: -2px;}
.post-stats.five {
position: absolute;
left: 257px;
top: 85px;}
.post-stats a{
text-decoration: none;
color: #2980b9;
}
.icon {
width: 25px; height: 45px;
}
.icon-tags {
background: url("/assets/course14/post-challenge.png") no-repeat;
position: relative;
top: 15px;
left: -20px;
}.icon-comments {
background: url("/assets/course14/post-challenge.png") no-repeat -20px 0;
position: relative;
top: 15px;
left: -20px;
}.post-text {
color: #7f8c8d;
background-color: #ffffff;
width: 165px;
padding: 10px 15px;
position: absolute;
top: 115px;
left: 85px;
border-bottom: 5px solid #bdc3c7;
margin-top: -3px;
}