<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="static/css/index.css">
<link rel="stylesheet" href="static/font_icon/iconfont.css">
</head>
<body>
<div class="header">
<!-- 搜索框 -->
<div class="search">
<div class="keys">
<span class="iconfont icon-fangdajing"></span>
<span>习近平主席访问俄罗斯</span>
</div>
<!-- 发布按钮 -->
<div class="publish">
<span class="iconfont icon-jiahao"></span>
<span>发布</span>
</div>
</div>
<!-- 导航条 -->
<div class="navs">
<a href="" class="active">推荐</a>
<a href="">科技</a>
<a href="">军事</a>
<a href="">两性</a>
<a href="">明星</a>
</div>
</div>
<!-- 主体 -->
<div class="main">
<div class="rec-list">
<a href="" class="item">
<span class="title">习近平主席访俄第一天,这些信息值得关注</span>
<div class="desc">
<span class="tag">置顶</span>
<div class="other">
<span>已关注</span>
<span>澎湃新闻</span>
<span>122条评论</span>
</div>
</div>
</a>
<a href="" class="item">
<span class="title">习近平主席访俄第一天,这些信息值得关注</span>
<div class="desc">
<span class="tag">置顶</span>
<div class="other">
<span>已关注</span>
<span>澎湃新闻</span>
<span>122条评论</span>
</div>
</div>
</a>
<a href="" class="item">
<span class="title">习近平主席访俄第一天,这些信息值得关注</span>
<div class="desc">
<span class="tag">置顶</span>
<div class="other">
<span>已关注</span>
<span>澎湃新闻</span>
<span>122条评论</span>
</div>
</div>
</a>
<a href="" class="item">
<span class="title">习近平主席访俄第一天,这些信息值得关注</span>
<div class="desc">
<span class="tag">置顶</span>
<div class="other">
<span>已关注</span>
<span>澎湃新闻</span>
<span>122条评论</span>
</div>
</div>
</a>
</div>
<!-- 左文本+右图片 -->
<div class="img1-list">
<a href="" class="item">
<!-- 文本 -->
<div class="left">
<div class="title">还派什么大使,美图晾了我们14个月,是时候反击了</div>
<div class="desc">
<span class="author">魂淡君</span>
<span class="replay-num">98条评价</span>
<span class="time">1小时前</span>
</div>
</div>
<!-- 图片 -->
<img src="static/images/1.jpeg" class="right">
</a>
<a href="" class="item">
<!-- 文本 -->
<div class="left">
<div class="title">还派什么大使,美图晾了我们14个月,是时候反击了</div>
<div class="desc">
<span class="author">魂淡君</span>
<span class="replay-num">98条评价</span>
<span class="time">1小时前</span>
</div>
</div>
<!-- 图片 -->
<img src="static/images/1.jpeg" class="right">
</a>
<a href="" class="item">
<!-- 文本 -->
<div class="left">
<div class="title">还派什么大使,美图晾了我们14个月,是时候反击了</div>
<div class="desc">
<span class="author">魂淡君</span>
<span class="replay-num">98条评价</span>
<span class="time">1小时前</span>
</div>
</div>
<!-- 图片 -->
<img src="static/images/1.jpeg" class="right">
</a>
<a href="" class="item">
<!-- 文本 -->
<div class="left">
<div class="title">还派什么大使,美图晾了我们14个月,是时候反击了</div>
<div class="desc">
<span class="author">魂淡君</span>
<span class="replay-num">98条评价</span>
<span class="time">1小时前</span>
</div>
</div>
<!-- 图片 -->
<img src="static/images/1.jpeg" class="right">
</a>
<a href="" class="item">
<!-- 文本 -->
<div class="left">
<div class="title">还派什么大使,美图晾了我们14个月,是时候反击了</div>
<div class="desc">
<span class="author">魂淡君</span>
<span class="replay-num">98条评价</span>
<span class="time">1小时前</span>
</div>
</div>
<!-- 图片 -->
<img src="static/images/1.jpeg" class="right">
</a>
</div>
<div class="img2-list">
<a href="" class="item">
<div class="title">2001年金吉奇用承诺诱捕米洛舍维奇</div>
<div class="imgs">
<img src="static/images/2.jpeg">
<img src="static/images/2.jpeg">
<img src="static/images/2.jpeg">
</div>
</a>
<a href="" class="item">
<div class="title">2001年金吉奇用承诺诱捕米洛舍维奇</div>
<div class="imgs">
<img src="static/images/2.jpeg">
<img src="static/images/2.jpeg">
<img src="static/images/2.jpeg">
</div>
</a>
<a href="" class="item">
<div class="title">2001年金吉奇用承诺诱捕米洛舍维奇</div>
<div class="imgs">
<img src="static/images/2.jpeg">
<img src="static/images/2.jpeg">
<img src="static/images/2.jpeg">
</div>
</a>
<a href="" class="item">
<div class="title">2001年金吉奇用承诺诱捕米洛舍维奇</div>
<div class="imgs">
<img src="static/images/2.jpeg">
<img src="static/images/2.jpeg">
<img src="static/images/2.jpeg">
</div>
</a>
</div>
<!-- 上面文本,下面视频 -->
<div class="video-list">
<a href="" class="item">
<div class="title">一生必须要去的5个地方,不要等老了才想来了,就太迟了,带上爱人现在出发</div>
<video src="static/images/v1.mp4" controls></video>
</a>
<a href="" class="item">
<div class="title">一生必须要去的5个地方,不要等老了才想来了,就太迟了,带上爱人现在出发</div>
<video src="static/images/v1.mp4" controls></video>
</a>
<a href="" class="item">
<div class="title">一生必须要去的5个地方,不要等老了才想来了,就太迟了,带上爱人现在出发</div>
<video src="static/images/v1.mp4" controls></video>
</a>
<a href="" class="item">
<div class="title">一生必须要去的5个地方,不要等老了才想来了,就太迟了,带上爱人现在出发</div>
<video src="static/images/v1.mp4" controls></video>
</a>
</div>
</div>
<!-- 页脚部分 -->
<div class="footer">
<a href="" class="active">
<span class="iconfont icon-shouye"></span>
<span>首页</span>
</a>
<a href="" class="active">
<span class="iconfont icon-24gl-play"></span>
<span>视频</span>
</a>
<a href="" class="active">
<span class="iconfont icon-yonghuguanli_huaban"></span>
<span>图片</span>
</a>
<a href="" class="active">
<span class="iconfont icon-yonghu"></span>
<span>我的</span>
</a>
</div>
</body>
</html>
css部分
/* 通用设置 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
a {
text-decoration: none;
color: #555;
}
html{
font-size: calc(100vw / 3.75);
}
body{
font-size: 0.16rem;
color: #333;
background-color: #fff;
margin: 0 auto;
padding: 0 0.15rem;
}
body img,
body video{
width: 100%;
}
@media (max-width:320px) {
html{
font-size: 85px;
}
}
@media (min-width:640px) {
html{
font-size: 170px;
}
}
/* 头部 */
.header {
/* 使用固定定位 */
position: fixed;
left: 0;
top: 0;
right: 0;
border-bottom: 1px solid #ccc;
/* 确保永远在前面 */
z-index: 9999;
background-color: #fff;
}
/* 搜索框 */
.header .search{
background-color: red;
padding: 0.08rem 0.15rem;
/* 左面是输入框,右面是发布按钮,使用grid */
display: grid;
grid-template-columns: 1fr 0.5rem;
}
/* 关键字 */
.header .search .keys{
background-color: #fff;
border-radius: 1.5rem;
display: flex;
place-items: center;
padding-left: 0.1rem;
}
/* 发布按钮 */
.header .publish{
color: white;
display: grid;
place-items: center;
}
/* 导航条 */
.header .navs{
display: flex;
place-content: space-around;
/* padding: 0.1rem 0 0.5rem; */
}
/* 首个选中 */
.header .navs a.active{
color: red;
}
/* 选中后下方红条 */
.header .navs a{
position: relative;
}
.header .navs a.active::after{
content: '';
position: absolute;
left: 0;
width: 0.3rem;
height: 0.03rem;
bottom: -0.04rem;
background-color: red;
}
/* **********主体部分 ********************/
.main{
min-height: 2000px;
position: relative;
top: 0.8rem;
padding-bottom: 0.6rem;
}
/* 文本和标签 */
.main .rec-list .item{
display: block;
margin-top: 0.1rem;
}
.main .rec-list .item .desc{
display: flex;
font-size: xx-small;
gap: 0.1rem;
}
/* 标签 */
.main .rec-list .item .desc .tag{
color: red;
}
.main .rec-list .item .desc .other{
color: #ccc;
}
/* 左文本和右图片 */
.main .img1-list .item{
margin-top: 0.1rem;
display: grid;
grid-template-columns: 1fr 1.3rem;
gap: 0.2rem;
}
.main .img1-list .item .left{
display: grid;
place-content: space-between;
}
.main .img1-list .item .left .desc{
font-size: xx-small;
color: #ccc;
}
/* 上面文本和下面图片 */
.main .img2-list .item{
display: block;
margin-top: 0.1rem;
}
.main .img2-list .item .imgs{
display: grid;
grid-template-columns: repeat(3,1fr);
gap: 0.05rem;
}
/* 视频部分 */
.main .video-list .item{
display: block;
margin-top: 0.1rem;
}
/***************** 底部 ****************/
.footer{
position: fixed;
left: 0;
right: 0;
bottom: 0;
background-color: #efefef;
display: flex;
place-content: space-around;
}
.footer a{
display: grid;
place-items: center;
font-size: x-small;
}
.footer a .iconfont{
font-size: xx-small;
}
/* 首个选中 */
.footer a .active{
color: red;
}