
批改狀態(tài):合格
老師批語(yǔ):
css 部分代碼
我們使用了grid 布局
grid-template-columns: 屬性負(fù)責(zé)把窗口進(jìn)行表格化
gap 是負(fù)責(zé)把項(xiàng)目的間隙分開(kāi)
<style>
body {
background-color: beige;
}
body a {
text-decoration: none;
color: rgb(0, 255, 60);
font-size: small;
}
a:hover {
color: red;
}
.lastcenten {
width: 1020px;
border: 1px solid #000;
margin: 0 auto;
}
/* 使用grid 布局 */
.lastcenten .bodges {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 30px 10px;
}
.bodges .curse {
overflow: hidden;
}
.lastcenten .bodges img {
width: 100%;
border-radius: 5px 5px 0 0;
}
.lastcenten .bodges img:hover {
transform: scale(1.1);
transition: all 0.3s;
}
.bodges .bodges_centent {
background-color: #fff;
border-radius: 0 0 5px 5px;
padding: 15px;
}
.bodges_centent .title span {
color: red;
background-color: bisque;
border-radius: 2px;
padding: 3px 4px;
text-align: center;
font-size: x-small;
}
.bodges_centent .bodges_botton {
display: flex;
place-content: space-between;
font-size: small;
color: #aaa;
margin-top: 10px;
gap: 10px;
padding: 2px;
}
</style>
div 部分代碼
<div class="lastcenten">
<h2>最新課程</h2>
<div class="bodges">
<div class="curse">
<a href="">
<img src="https://img.php.cn/upload/course/000/000/068/6413e7ac3ce52126.jpg" alt="">
</a>
<div class="bodges_centent">
<div class="title">
<span>中級(jí) </span>
<a href="">php 編程從零到就業(yè)(2023 最新課程)</a>
</div>
<div class="bodges_botton">
<span>34345學(xué)習(xí)</span>
<span>收藏</span>
</div>
</div>
</div>
</div>
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號(hào)
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)