如何用css3实现一个扇形?

思路跟画实体三角形一个道理,只不过多了一个圆角属性

代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>c3扇形</title>
    <style>
        .sector{
            width0;
            height0;
            border-width50px;
            border-style: solid;
            border-color#f00 transparent transparent;
            border-radius50px
        }
    </style>
</head>
<body>
    <div class="sector"></div>
</body>
</html>

 

原文地址:https://www.cnblogs.com/akby/p/12819809.html