grid仿PHP中文网 php入门精品课程
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>flex-grid</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
overflow-y: auto;
font: 14px 微软雅黑;
background: #f3f5f7;
}
a {
text-decoration: none;
}
.container {
width: 1200px;
height: 650px;
margin: 10px auto;
background: #fff;
display: grid;
grid-template-columns: repeat(5, 20%);
grid-template-rows: 80px 190px 190px 190px;
}
.container .item:first-of-type {
grid-column: span 5;
line-height: 80px;
text-align: center;
font-size: 1.5em;
font-weight: 800;
color: #4d555d;
}
.container .item:nth-child(2) {
grid-row: span 2;
margin: 0 auto;
/* background: red; */
}
.container .item:nth-child(2) img {
border-radius: 8px;
}
.container .item:nth-child(n + 3) {
margin: 0 auto;
position: relative;
}
.container .item:nth-child(n + 3) img {
width: 217px;
height: 124px;
border-radius: 8px;
}
a {
display: block;
border-radius: 8px;
padding: 15px 20px;
position: absolute;
top: 94px;
transition: top 0.5s;
height: 90px;
width: 100%;
background: #fff;
color: #555;
}
.container .item:nth-child(n + 3) a:hover {
color: #333;
top: 50px;
}
.container .item:nth-child(n + 3) span {
position: absolute;
top: 130px;
left: 0;
width: 217px;
height: 40px;
padding: 0 20px;
line-height: 40px;
background: #fff;
color: #93999f;
font-size: 12px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
}
.container .item i {
font-size: 0.5em;
margin-right: 5px;
padding: 2px;
color: white;
background-color: rgba(0, 0, 0, 0.239);
}
</style>
</head>
<body>
<div class="container">
<div class="item">php入门精品课程</div>
<div class="item"><img src="images/01.jpg" alt="" /></div>
<div class="item">
<img src="images/02.png" alt="" />
<a href=""><i>初级</i>编程学习方法分享直播公益课</a>
<span>1W+次播放</span>
</div>
<div class="item">
<img src="images/03.jpg" alt="" />
<a href=""><i>初级</i>2018前端入门_HTML5</a>
<span>18W+次播放</span>
</div>
<div class="item">
<img src="images/04.jpg" alt="" />
<a href=""><i>初级</i>CSS视频教程-玉女心经版</a>
<span>10W+次播放</span>
</div>
<div class="item">
<img src="images/05.jpg" alt="" />
<a href=""><i>初级</i>JavaScript极速入门_玉女心经系列</a>
<span>18W+次播放</span>
</div>
<div class="item">
<img src="images/06.jpg" alt="" />
<a href=""><i>初级</i>独孤九贱(6)_jQuery视频教程</a>
<span>12W+次播放</span>
</div>
<div class="item">
<img src="images/07.jpg" alt="" />
<a href=""><i>初级</i>30分钟学会网站布局</a>
<span>6W+次播放</span>
</div>
<div class="item">
<img src="images/08.jpg" alt="" />
<a href=""><i>初级</i>ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</div>
<div class="item">
<img src="images/09.jpg" alt="" />
<a href=""><i>初级</i>[公益直播]Web前端开发极速入门</a>
<span>5W+次播放</span>
</div>
<div class="item">
<img src="images/10.jpg" alt="" />
<a href=""><i>初级</i>phpStudy极速入门视频教程</a>
<span>40W+次播放</span>
</div>
<div class="item">
<img src="images/11.jpg" alt="" />
<a href=""><i>初级</i>ThinkPHP6.0极速入门(视频教程)</a>
<span>35W+次播放</span>
</div>
<div class="item">
<img src="images/12.jpg" alt="" />
<a href=""><i>初级</i>php完全自学手册</a>
<span>36W+次播放</span>
</div>
<div class="item">
<img src="images/13.jpg" alt="" />
<a href=""><i>初级</i>MySQL权威开发指南(教程)</a>
<span>4W+次播放</span>
</div>
<div class="item">
<img src="images/14.jpg" alt="" />
<a href=""><i>初级</i>[公益直播]PHP实战开发极速入门</a>
<span>4W+次播放</span>
</div>
</div>
</body>
</html>
原图
仿图
参考了同学老周的作业,学习到了不错运用方式。还要多练手,多练手,多练手,多练手。
重要的事要多说几遍。