18/18

Доброго времени суток! Выполнил задание, но хочется исправить ошибки если такие имеются.

Код 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 {
position: relative;
padding-left: 75px;

}

.post-title {
font-size: 20px;
color: #2980b9;
margin-bottom: 5px;

}

.post-date {
display: inline-block;
position: absolute;
top: 0;
left: 0;
width: 55px;
height: 55px;
line-height: 55px;
text-align: center;
font-size: 15px;
font-weight: bold;
background: #ffffff;
border-bottom: 5px solid #bdc3c7;

}

.post-type {
display: inline-block;
position: absolute;
top: 70px;
left: 0;
width: 55px;
height: 55px;
background: #7f8c8d url("/assets/course14/quotes.png") no-repeat 50% 50%;
border-bottom: 5px solid #bdc3c7;

}

.post-author {
margin-bottom: 5px;

}

.post-author a {
text-decoration: none;
color: #2980b9;

}

.post-stats {
position: relative;
display: inline-block;
margin-right: 10px;
padding-left: 20px;

}

.post-stats .icon {
position: absolute;
width: 15px;
height: 15px; 

}

.icon-tags {
left: 0;
background: url("/assets/course14/post-challenge.png") no-repeat;

}

.post-stats a {
text-decoration: none;
color: #2980b9;

}

.icon-comments {
top: 0;
right: 11px;
background: url("/assets/course14/post-challenge.png") no-repeat -20px 0;

}

.post-text {
margin-right: 10px;
padding: 10px 10px 10px 15px;
background: #ffffff;
border-bottom: 5px solid #bdc3c7;

}

Одна координата не кратна пяти у вас. Других замечаний нет.

Вот теперь бы разобраться только, почему она не кратна пяти. Отступа в 10px не хватает для идеального совпадения с образцом.

Разобрался, ошибка была в абсолютном позиционировании элемента.

.icon-comments {
top: 0;
left: 0px;
background: url("/assets/course14/post-challenge.png") no-repeat -20px 0;
}

Изначально значение было right: 11px.

1 лайк