console
<div class="header">
<h1>朋友圈demo</h1>
<div class="header-user">
<p>CalDey</p>
<a href="https://www.caldey-blog.top">
<img src="https://gitee.com/caldey/BlogImage/raw/master/img/avatar.jpg" alt="">
</a>
</div>
</div>
<div class="main">
<ol>
<li class="item">
<a href="#" class="avatar"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/matthew.png" alt=""></a>
<div class="content">
<p>Mike123</p>
<p>九宫格图片test</p>
<ul>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/nutcracker-5767159_1920.jpg" alt=""></a>
</li>
</ul>
<div class="timestamp">
<p>2小时前</p>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/star.png" alt=""></a>
</div>
<div class="comments">
<p class="zan"><a href="#">Carrie</a></p>
<p><a href="#">Carrie</a>: 点赞了</p>
</div>
</div>
</li>
<li class="item">
<a href="#" class="avatar"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/rachel.png" alt=""></a>
<div class="content">
<p>Rachel</p>
<p>转发</p>
<div class="zhuanfa">
<a href="#">
<img src="https://gitee.com/caldey/BlogImage/raw/master/img/polar-lights-5858656_1920.jpg" alt="">
<p>早安,打工人</p>
</a>
</div>
<div class="timestamp">
<p>3小时前</p>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/star.png" alt=""></a>
</div>
</div>
</li>
<li class="item">
<a href="#" class="avatar"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/mark.png" alt=""></a>
<div class="content">
<p>小劉同学</p>
<p>这几天自学了HTML和CSS,可以自己做网站了,开心~</p>
<ul>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/laptop-5842509_1920.jpg" alt=""></a>
</li>
</ul>
<div class="timestamp">
<p>三小时前</p>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/star.png" alt=""></a>
</div>
<div class="comments">
<p class="zan"><a href="#">LuLu</a></p>
<p><a href="#">Carrie</a>: 厉害了!有空教教我</p>
</div>
</div>
</li>
<li class="item">
<a href="#" class="avatar"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/avatar.jpg" alt=""></a>
<div class="content">
<p>CalDey</p>
<p>如果觉得不错就关注我和我一起学习前端吧,使用微信扫描下面的二维码即可关注</p>
<ul>
<li>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/my_wechat.jpg" alt=""></a>
</li>
</ul>
<div class="timestamp">
<p>一天前</p>
<a href="#"><img src="https://gitee.com/caldey/BlogImage/raw/master/img/star.png" alt=""></a>
</div>
<div class="comments">
<p class="zan">
<a href="#">Carrie</a>,
<a href="#">Mike123</a>,
<a href="#">小劉同学</a>
</p>
<p><a href="#">我</a>:如果喜欢的话,麻烦点个赞</p>
<p><a href="#">Carrie</a>:关注了!!!</p>
<p><a href="#">小劉同学</a>回复<a href="#">我</a>:支持一下</p>
</div>
</div>
</li>
</ol>
</div>
* {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
}
ul {
list-style: none;
}
body {
font: 17px/24px "PingFangSC-Regular";
background-color: #fff;
min-width: 320px;
max-width: 414px;
margin: 0 auto;
}
.header {
width: 100%;
height: 319px;
background: url('https://gitee.com/caldey/BlogImage/raw/master/img/concert-3084876_1920.jpg') no-repeat center;
background-size: cover;
position: relative;
}
.header>h1 {
height: 100%;
line-height: 319px;
text-align: center;
color: #fff;
font-size: 44px;
font-style: italic;
}
.header-user {
position: absolute;
right: 12px;
bottom: -20px;
display: flex;
justify-content: right;
}
.header-user>p {
color: #fff;
margin-top: 16px;
margin-right: 20px;
font-weight: bold;
}
.header-user>a>img {
width: 72px;
height: 72px;
border-radius: 6px;
background: #4e92ef;
}
.main>ol {
padding-top: 60px;
}
.main .item {
padding: 10px;
display: flex;
border-bottom: 1px solid #EBEBEC;
}
.item .avatar>img {
display: inline-block;
width: 44px;
height: 44px;
border-radius: 4px;
background: #2c5948;
}
.item .content {
width: 100%;
margin-left: 10px;
}
.item .content>p:first-child {
margin-bottom: 10px;
font-size: 17px;
color: #4D638F;
}
.item .content>ul {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
align-content: space-between;
margin: 10px 0;
}
.item .content>ul>li {
width: 80px;
height: 80px;
}
.item .content>ul>li>a>img {
display: inline-block;
background: brown;
width: 100%;
height: 100%;
}
.content .timestamp {
display: flex;
justify-content: space-between;
padding: 5px 0;
}
.content .timestamp>p {
font-size: 14px;
color: #b7b7b7;
}
.content .timestamp>a>img {
width: 29px;
vertical-align: middle;
}
.content .comments {
background: #F3F3F5;
border-radius: 2px;
}
.comments p {
font-size: 15px;
color: #000;
padding: 5px;
}
.comments .zan a:nth-child(1):before {
content: '';
display: inline-block;
width: 11px;
height: 10px;
margin-right: 8px;
background: url('https://gitee.com/caldey/BlogImage/raw/master/img/star_small.png') no-repeat center;
background-size: cover;
vertical-align: middle;
}
.comments p+p {
border-top: 1px solid #EBEBEC;
}
.comments p a {
color: #536892;
}
.item:nth-child(1) .content>ul {
width: 250px;
height: 250px;
}
.item:nth-child(2) .zhuanfa {
background-color: #F3F3F5;
padding: 4px;
margin: 10px 0;
}
.item:nth-child(2) .zhuanfa>a {
display: flex;
justify-content: left;
align-items: center;
}
.item:nth-child(2) .zhuanfa>a>img {
width: 42px;
height: 42px;
display: inline-block;
background: #6f989e;
}
.item:nth-child(2) .zhuanfa>a>p {
font-size: 15px;
color: #121212;
margin-left: 10px;
}
.item:nth-child(3) .content>ul>li {
width: 260px;
height: 162px;
}
.item:nth-child(4) .content>ul>li {
width: 174px;
height: 174px;
}
.item:nth-child(4) .content>ul>li>a>img {
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.50);
}