老师,请检查下,哪里还需要改进?
<!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;
}
/* 最外层盒子的整体宽高 */
.shop {
position: relative;
overflow: hidden;
width: 800px;
height: 200px;
margin: 40px auto;
background-color: rgba(0, 0, 0, .1)
}
/* 提交按钮左浮动 */
.shop .btn {
position: absolute;
float: left;
width: 153px;
height: 76px;
left: 50px;
top: 50%;
margin-top: -38px;
}
/* 购物车右浮动 */
.shop .cart {
position: absolute;
float: right;
width: 200px;
height: 200px;
top: 0;
right: 50px;
}
/* 购买数量 */
.shop .cart span {
position: absolute;
display: block;
width: 40px;
height: 40px;
top: 10px;
right: 0;
font-size: 30px;
line-height: 40px;
color: white;
text-align: center;
border-radius: 50%;
background-color: red;
}
</style>
</head>
<body>
<div class="shop">
<div class="btn ">
<a href="">
<img src="./image/btn.png" alt="提交">
</a>
</div>
<div class="cart">
<a href="">
<img src="./image/cart.png" alt="购物车">
</a>
<span>3</span>
</div>
</div>
</body>
</html>9
收起
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星