目标:
代码:
<!DOCTYPE html>
<html lang="en">
<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>
<style>
* {
margin: 0;
padding: 0;
}
body {
background-color: #cccc;
}
a {
text-decoration: none;
}
div {
width: 234px;
height: 260px;
background-color: #fff;
margin: 0 auto;
text-align: center;
padding: 20px 0;
}
div img {
width: 160px;
height: 160px;
}
div h4 {
color: #333;
margin: 0 10px 2px;
font-weight: 400;
}
.use {
height: 18px;
width: 214px;
margin: 0 10px 10px;
color: #B0B0B0;
}
.p1 {
color: #FF6700;
margin-right: 15px;
}
.p2 {
color: #B0B0B0;
text-decoration: line-through;
}
.prize {
height: 21px;
width: 214px;
margin: 0 10px 14px;
}
em {
font-style: normal;
}
</style>
</head>
<body>
<a href="#">
<div>
<img src="img.gif">
<h4>Redmi Buds 3</h4>
<p class="use">
<span>轻巧半入耳</span>
<em>|</em>
<span>通话降噪</span>
<em>|</em>
<span>20小时长续航</span>
</p>
<p class="prize">
<span class="p1">159元</span>
<span class="p2">199元</span>
</p>
</div>
</a>
</body>
</html>
最终呈现效果: