纯CSS:
#container {
position: relative;
width: 100%;
padding-bottom: 100%;
}
#circle {
position: absolute;
width: 50%;
height: 50%;
background-color: #000000;
border-radius: 50%;
}
#small-circle{
margin-top: 25%;
margin-left: 25%;
position: absolute;
width: 50%;
height: 50%;
background-color: #e5e5e5;
border-radius: 50%;
}
Run Code Online (Sandbox Code Playgroud)
和HTML:
<div id="container">
<div id="circle">
<div id="small-circle">
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
参见演示
啊...svg 可以帮忙吗?如果需要,你可以在它的元素上使用CSS,但我认为你可以做到严格而简单:
<!DOCTYPE html >
<html>
<head>
<title> Bla! </title>
</head>
<body>
<svg>
<circle cx="80" cy="80" r="40" fill='red' stroke-width="20" stroke='black'/ >
</svg>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10462 次 |
| 最近记录: |