关于css:css绘制眼镜练习

2次阅读

共计 775 个字符,预计需要花费 2 分钟才能阅读完成。

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title> 眼镜黑心圆半径为 10, 外圆半径为 40, 眼镜架长度 100, 歪斜 45 度 </title>
</head>
<style type="text/css">
    .content {background: rgb(77, 203, 249);
        height: 300px;
        width: 300px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .round {
        border: 3px solid blue;
        height: 90px;
        width: 90px;
        border-radius: 100px;
        position: relative;
    }
    .circle {
        background: black;
        height: 20px;
        width: 20px;
        border-radius: 100px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    .line {
        background: blue;
        height: 100px;
        width: 3px;
        position: absolute;
        bottom: 85%;
        left: 85%;
        transform: rotate(45deg);
    }
</style>
<body>
    <div class="content">
        <div class="round">
            <div class="line"></div>
            <div class="circle"></div>
        </div>
        <div class="round">
            <div class="line"></div>
            <div class="circle"></div>
        </div>
    </div>
</body>
</html>

效果图:

正文完
 0