如何用html 与css 编制一个网页元素(盒子)
<!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: #f4f4f4;
}
.box {
border:1px solid transparent;
width: 294px;
height: 376px;
background-color: #ffff;
margin: 100px auto;
}
.lei {
width: 100%;
height: 215;
}
.box img {
width: 195px;
height: 143px;
padding:58px 46px 0px 52px ;
}
h1 {
font-size: 16px;
display: block;
width: 179px;
height: 23px;
padding: 0 46px 0 64PX;
margin: 49px 0px 0px 10px ;
color: #333;
font-weight: 400;
}
.biao {
display: block;
width: 134px;
height: 17px;
font-size: 10px;
padding: 0px 56px 0px 84px;
margin-top: 10px;
color: #b0b0b0;
}
a {
display: block;
text-decoration: none;
}
a:hover {
box-shadow: 10px 10px 6px 8px gainsboro;
}
.mo {
display: block;
width: 90px;
height: 42px;
font-size: 10px;
padding: 16px 93px 0px 121px;
margin-top: 10px;
color: red;
}
</style>
</head>
<body>
<div class="box"><a href="#">
<div class="lei"><img src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/82ff5ea76730fdf6f91aba5d3b2e5739.jpg?thumb=1&w=250&h=250&f=webp&q=90"/></div>
<h1>小米电视6 65" OLED</h1>
<span class="biao">小米电视6 65" OLED</span>
<span class="mo">2790元</span>
</a>
</div>
</body>
</html>
结果显示图为
