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

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

<!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下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

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