效果图
<!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: 0;
padding: 0;
}
.bigbox {
width: 890px;
height: 290px;
/* background-color: orange; */
/* 水平居中 */
margin: 0 auto;
/* 添加溢出有滚动条 */
overflow: auto;
}
.bigbox>div {
width: 164px;
height: 114px;
border: 1px solid gray;
/* 解决1px 撑大的问题 */
box-sizing: border-box;
float: left;
margin-right: 48px;
margin-bottom: 20px
}
.bigbox dl {
height: 84px;
background-color: #cccccc;
color: #b5b5b5;
text-indent: 18px;
}
.bigbox p {
height: 28px;
/* background-color: green; */
font-size: 14px;
text-align: center;
line-height: 28px;
}
.bigbox dt {
font-size: 14px;
line-height: 50px;
}
.bigbox dd {
font-size: 12px;
}
/* 划过效果 */
/* 鼠标放在父元素上面改变子元素 */
.bigbox>div:hover>dl{
background-color: deepskyblue;
color:white
}
.bigbox>div:hover>p{
color:deepskyblue;
background: url(../img/thr.png) no-repeat right bottom;
}
</style>
</head>
<body>
<!-- 居中的一个版心 -->
<div class="bigbox">
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
<div>
<dl>
<dt>¥100.00元</dt>
<dd>有效期至:2023-11-11</dd>
</dl>
<p>
[店铺类] [商城类]
</p>
</div>
</div>
</body>
</html>