main.css代码
main {
font-size: 14px;
}
main .navs{
display: grid;
grid-template-columns: 160px 810px 190px;
grid-template-rows: 400px 80px;
gap:20px;
place-content: center;
margin: 10px 0 20px;
}
main .navs > * {
background-color: #fff;
border-radius: 12px;
}
main .navs .slider a img{
width:100%;
border-radius: 12px;
}
main .navs .left{
padding: 20px 0;
display: grid;
place-items: center;
}
main .navs .left a{
padding:10px 20px;
}
main .navs .left a:hover{
border-radius: 20px;
color:red;
background-color: rgb(250,223,227);
}
main .navs .right{
display:grid;
grid-template-rows: 75px 75px 1fr;
}
main .navs .right .user{
display:flex;
place-content: space-evenly;
place-items: center start;
}
main .navs .right .user li{
display: grid;
grid-template-columns: 40px 100px;
grid-template-rows: repeat(2,25px);
gap: 0 10px;
place-items: center start;
}
main .navs .right .user li a:first-of-type{
grid-row: span 2;
}
main .navs .right .user li a img{
width:100%;
border-radius: 50%;
}
main .navs .right .user li a{
font-size: 14px;
font-weight: bolder;
}
main .navs .right .user li a:hover,
main .navs .right .list li a:hover{
color:red;
}
main .navs .right .user li span{
color:#999;
}
main .navs .right .title a{
display: block;
width:150px;
height:34px;
margin-left: 20px;
margin-bottom: 30px;
text-align: center;
line-height: 34px;
background-color: red;
color: #fff;
border-radius: 20px;
}
main .navs .right .list{
display: grid;
padding: 10px 20px 5px;
}
main .navs .right .list li:first-of-type>a{
display: inline-block;
width:31px;
height:16px;
line-height: 16px;
border-radius: 2px;
background-color: red;
color:#fff;
font-size: 12px;
text-align: center;
}
main .navs .right .list li a{
margin-left: 10px;
color:#999;
}
main .navs .right .list .mid{
display: flex;
}
main .navs .right .list .mid span{
width:50px;
}
main .navs .bottom-left{
display: grid;
grid-column: span 2;
grid-template-columns: 100px 1fr;
}
main .navs .bottom-left .desc{
display: grid;
padding:16px 0;
place-items: center;
}
main .navs .bottom-left .desc span{
font-size: 12px;
color:#999;
}
main .navs .bottom-left .detail{
display: flex;
place-items: center;
place-content: space-between;
padding:20px;
}
main .navs .bottom-left .detail li{
display: grid;
grid-template-columns: 36px 85px;
grid-template-rows: repeat(2,20px);
gap: 0 10px;
place-items: center start ;
}
main .navs .bottom-left .detail li img{
width:100%;
grid-row:span 2;
}
main .navs .bottom-left .detail li a{
font-size: 14px;
}
main .navs .bottom-left .detail li a:hover{
color:red;
}
main .navs .bottom-left .detail li span{
font-size:12px;
color:#999;
}
main .navs .bottom-right{
display: flex;
place-items: center;
place-content: space-evenly;
}
main .navs .bottom-right li{
display:grid;
place-items: center;
gap:8px 0;
}
main .navs .bottom-right li span.icon-logo-wechat,
main .navs .bottom-right li span.icon-QQ-circle-fill{
font-size:32px;
color:#999;
}
main .navs .bottom-right li span:hover{
cursor: pointer;
}
main .navs .bottom-right li a:hover{
color:red;
}
main .navs .bottom-right li a{
font-size: 12px;
font-weight:bolder;
color: #515151;
}
这是case.html代码
<!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/header.css" />
<link rel="stylesheet" href="static/css/main.css">
<link rel="stylesheet" href="static/font/iconfont.css" />
</head>
<body>
<header>
<div class="top">
<div class="content">
<div class="title">php中文网-程序员梦开始的地方</div>
<div class="right">
<a href="" class="iconfont icon-tixing-tianchong myicon"></a>
<a href=""><img src="static/image/IMG_20210728_191104.jpg" alt="" /></a>
</div>
</div>
</div>
<div class="navs">
<div class="content">
<a href=""><img src="static/image/logo.png" alt="" /></a>
<nav>
<a href="" class="active">首页</a>
<a href="">教学视频</a>
<a href="">学习路径</a>
<a href="">社区问答</a>
</nav>
<div class="search">
<input type="search" placeholder="输入关键字" />
<span class="iconfont icon-fangdajing1"></span>
</div>
</div>
</div>
</header>
<main>
<div class="navs">
<div class="left">
<a href="">php开发</a>
<a href="">大前端</a>
<a href="">后端开发</a>
<a href="">数据库</a>
<a href="">移动端</a>
<a href="">运维开发</a>
<a href="">UI设计</a>
<a href="">计算机基础</a>
</div>
<div class="slider">
<a href=""><img src="static/image/736f835f2907e552e0257e59ec635a10_62fdcfb67b3b8383.png" alt=""></a>
</div>
<div class="right">
<div class="user">
<li>
<a href=""><img src="static/image/user_avatar.jpg" alt=""></a>
<a href="">P粉8549...</a>
<span>p豆 18</span>
</li>
</div>
<div class="title">
<a href="">我的学习</a>
<hr style="height:1px;border:none;border-top:1px solid #eee">
</div>
<div class="list">
<li>问答社区<a href="">答疑</a></li>
<li class="mid">
<span>头条</span>
<a href="">9个vue3开发技巧,提升效率帮</a>
</li>
<li>福利<a href="">限时折扣>></a></li>
<li>新班<a href="">21期PHP直播班</a></li>
<li>招募<a href="">课程合作计划</a></li>
<li>公告<a href="">APP上线啦</a></li>
</div>
</div>
<div class="bottom-left">
<div class="desc">
<div class="title">学习路径</div>
<span>全部7个></span>
</div>
<div class="detail">
<li onclick="">
<img src="static/image/dgjj.png" alt="">
<a href="">独孤九剑</a>
<span>9门课程</span>
</li>
<li onclick="">
<img src="static/image/phpkjkf.png" alt="">
<a href="">玉女心经</a>
<span>5门课程</span>
</li>
<li onclick="">
<img src="static/image/phpksrm.png" alt="">
<a href="">天龙八部</a>
<span>3门课程</span>
</li>
<li onclick="">
<img src="static/image/tlbb.png" alt="">
<a href="">自学指南</a>
<span>19门课程</span>
</li>
<li onclick="">
<img src="static/image/ynxj.png" alt="">
<a href="">趣味闯关</a>
<span>22门课程</span>
</li>
</div>
</div>
<div class="bottom-right">
<li>
<span class="iconfont icon-logo-wechat"></span>
<a href="">官方公众号</a>
</li>
<li>
<span class="iconfont icon-QQ-circle-fill"></span>
<a href="">官方QQ群</a>
</li>
</div>
</div>
</main>
</body>
</html>