老师,请检查下,哪里还需要改进?

老师,请检查下,哪里还需要改进?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!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>


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
imooc_慕慕 2022-12-05 09:39:00

同学你好,代码可以实现效果很棒,不需要改进了,祝学习愉快~

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师
插入代码