css3百分比圆环怎么画
发布网友
发布时间:2022-04-25 20:11
我来回答
共2个回答
热心网友
时间:2022-04-21 09:17
把代码复制到html文件里运行到浏览器上查看一下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<title></title>
</head>
<style>
.adaptive-circle {
margin: 50px auto 0;
width: 80%;
height: 0;
padding-top: 80%;
border-radius: 100%;
border: 1px solid #000;
box-sizing: border-box;
position: relative;
}
.adaptive-circle .layout {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
text-align: center;
}
.adaptive-circle .layout.middle:before {
display: inline-block;
vertical-align: middle;
content: '';
height: 100%;
width: 0;
overflow: hidden;
}
.adaptive-circle .layout.middle div:first-child {
display: inline-block;
vertical-align: middle;
}
</style>
<body>
<div class="adaptive-circle">
<div class="layout middle">
<div>
<h2>自适应标题</h2>
<p>自适应介绍</p>
</div>
</div>
</div>
</body>
</html>
浏览器下 不同尺寸 变化大小:
热心网友
时间:2022-04-21 10:35
暂时只能用边框做一个空心圆,再加个border-radius:50%圆角; 而且也有*,只能化4份