老师这个蝴蝶结的代码是否需要改进

来源:2-11 编程练习

ZcKing

2020-12-17 16:48:46

# 具体遇到的问题

# 报错信息的截图

# 相关课程内容截图

# 尝试过的解决思路和结果

# 粘贴全部相关代码,切记添加代码注释(请勿截图)

<!DOCTYPE html>

<html>


<head>

    <meta charset="UTF-8">

    <title>边框</title>

    <style>

            /*补充代码*/

            .box {

                width: 500px;

                height: 500px;

                position: relative;

            }

        

            .box .bd1 {

                width: 0;

                height: 0;

                border: 100px solid transparent;

                border-left-color: red;

                border-top-left-radius: 80px;

                border-bottom-left-radius: 80px;

        

            }

        

            .box .bd2 {

                position: absolute;

                width: 0;

                height: 0;

                border: 100px solid transparent;

                border-right-color: red;

                border-top-right-radius: 80px;

                border-bottom-right-radius: 80px;

                top: 0;

                left: -20px;

            }

    </style>

</head>


<body>

    <div class="box">

        <div class="bd1"></div>

        <div class="bd2"></div>

    </div>

</body>


</html>


写回答

1回答

好帮手慕慕子

2020-12-17

同学你好, 效果实现是正确的,代码也很简洁,不用再改进了,继续加油,祝学习愉快~

0

0 学习 · 15276 问题

查看课程