- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Комментарии, шаг 5</title>
<link rel="stylesheet" href="setting.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="comment">
<div class="comment-avatar"></div>
<div class="comment-author">Дима Дивов</div>
<div class="comment-text">
Верстать сайты надо только на дивах!
<div class="comment-date">16.09.2013</div>
</div>
<a href="#reply" title="Ответить" class="comment-reply"></a>
</div>
<div class="comment">
<div class="comment-avatar"></div>
<div class="comment-author">Степан Спанов</div>
<div class="comment-text">
Не согласен, лучше спаны.
<div class="comment-date">17.09.2013</div>
</div>
<a href="#reply" title="Ответить" class="comment-reply"></a>
</div>
</body>
</html>
CSS
body {
font-size: 14px;
font-family: "PT Sans", sans-serif;
color: #777777;
}
.comment {
position: relative;
margin-top: 30px;
margin-right: 20px;
margin-left: 50px;
}
.comment-avatar {
width: 70px;
height: 70px;
background: #7f8c8c url("avatar.png") no-repeat 50% 50%;
}
.comment-author {
margin-bottom: 5px;
padding-right: 20px;
padding-left: 45px;
font-weight: bold;
font-size: 16px;
}
.comment-text {
padding: 12px;
padding-left: 45px;
background-color: #f8f8f8;
border-bottom: 5px solid #e5e6e6;
}
.comment-date {
margin-top: 5px;
font-size: 12px;
color: #bdc3c7;
}
.comment-reply {
position: absolute;
top: 0;
right: 0;
width: 15px;
height: 15px;
background: url("reply.png") no-repeat 0 0;
}
ЗадачиВыполнено
Задайте для .comment-avatar
:
- Абсолютное позиционирование.
- Координату сверху
-5px
. - Координату слева
-40px
.