使用div和css实现一个圆形,红色部分站60%,绿色40%
Sunny-117 opened this issue · comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=\, initial-scale=1.0" />
<title>Document</title>
</head>
<style>
body {
display: grid;
place-self: center;
height: 100vh;
width: 100vw;
}
.container {
width: 200px;
height: 200px;
border-radius: 50%;
background: red;
overflow: hidden;
}
.progress {
height: 50%;
width: inherit;
background: #0f0;
}
</style>
<body>
<div class="container">
<div class="progress"></div>
</div>
</body>
</html>
height: 40%