Correcting teacher:Guanhui
Correction status:qualified
Teacher's comments:课程的阴影可以调整一下,阴影太过深了!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
.course {
width: 1200px;
height: 647px;
margin: 10px auto;
}
/* 设置标题 */
.course > .course-title {
font-size: 1.2rem;
width: 1185px;
line-height: 30px;
text-align: center;
margin: 20px;
}
/* 设置gride布局 已将设置宽度了 直接设置高度即可*/
.course > .contariner {
height: 567px;
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-template-rows: repeat(3, 1fr);
}
/* 设置每个的项目在单元格的位置以及大小 */
.course > .contariner > .course-list {
width: 217px;
height: 172px;
box-shadow: 0 0 10px #555;
/* 设置项目垂直居上 水平居中 */
place-self: start center;
border-radius: 5%;
position: relative;
/* 隐藏p标签描述的文字超出问题 */
overflow: hidden;
}
.course > .contariner > .course-list:first-of-type {
grid-row: span 2;
height: 364px;
}
.course > .contariner > .course-list img {
/* 圆角 */
width: 100%;
border-radius: 5%;
}
/* 去掉下划线 */
.course > .contariner > .course-list > a {
text-decoration: none;
cursor: pointer;
}
/* 设置播放量 添加背景是为了隐藏与播放次数之间的文字*/
.course > .contariner > .course-list .num {
position: absolute;
width: 100%;
height: 42px;
padding: 0 20px;
bottom: 0px;
color: #93999f;
font-size: 12px;
line-height: 36px;
background-color: #fff;
border-radius: 8px;
}
/* 设置图片标题 */
.course > .contariner > .course-list .desc {
height: 40px;
font-size: 12px;
color: #656;
line-height: 21px;
padding: 16px 17px 6px;
position: relative;
top: -35px;
border-radius: 8px;
background-color: #fff;
}
/* 设置过度 */
.course > .contariner > .course-list > a > .desc:hover {
height: 130px;
margin-top: -60px;
transition: 0.5s;
}
.course > .contariner > .course-list .desc span {
padding: 2px;
margin-right: 4px;
margin-top: 2px;
font-size: 12px;
color: #fff;
line-height: 12px;
border-radius: 1px;
background-color: #93999f;
}
.course > .contariner > .course-list .desc p {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="course">
<div class="course-title">php入门精品课程</div>
<div class="contariner">
<div class="course-list"><img src="./images/1.jpg" alt="" /></div>
<div class="course-list">
<a href="">
<img src="./images/2.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>编程学习方法分享直播公益课</h3>
</div>
<div class="num">1w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/3.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>编程学习方法分享直播公益课</h3>
</div>
<div class="num">18w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/4.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>CSS视频教程-玉女心经版</h3>
<p>
本章节讲解的是有关CSS基础的内容,轻松明快,适合新手观看学习。
</p>
</div>
<div class="num">10w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/5.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>JavaScript极速入门_玉女心经系列</h3>
</div>
<div class="num">18w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/6.jpg" alt="" />
<div class="desc">
<h3><span>中级</span>独孤九贱(6)_jQuery视频教程</h3>
</div>
<div class="num">12w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/7.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>30分钟学会网站布局</h3>
</div>
<div class="num">6w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/8.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>[公益直播]Web前端开发极速入门</h3>
</div>
<div class="num">5w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/9.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>phpStudy极速入门视频教程</h3>
</div>
<div class="num">40w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/10.jpg" alt="" />
<div class="desc">
<h3><span>中级</span>ThinkPHP6.0极速入门(视频教程)</h3>
</div>
<div class="num">4w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/11.jpg" alt="" />
<div class="desc">
<h3><span>中级</span>独孤九贱(4)_PHP视频教程</h3>
</div>
<div class="num">40w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/12.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>php完全自学手册</h3>
</div>
<div class="num">20w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/13.jpg" alt="" />
<div class="desc">
<h3><span>初级</span>MySQL权威开发指南(教程)</h3>
</div>
<div class="num">2w+次播放</div>
</a>
</div>
<div class="course-list">
<a href="">
<img src="./images/14.jpg" alt="" />
<div class="desc">
<h3><span>中级</span>[公益直播]PHP实战开发极速入门</h3>
</div>
<div class="num">3w+次播放</div>
</a>
</div>
</div>
</div>
</body>
</html>