【HTML】纯CSS+DIV实现动态饼状图代码
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
CSS 动态饼状图属于前端实例代码,有关更多实例代码大家可以查看。 分享一段代码实例,它实现了动态饼状图下效果。 代码实例如下: <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="https://www.pipipi.net/" />
<title>前端教程网</title>
<style>
.pie {
width: 140px;
height: 140px;
border-radius: 50%;
background: yellowgreen;
background-image: linear-gradient(to right, transparent 50%, currentColor 0);
color: #655;
}
.pie::before {
content: '';
display: block;
margin-left: 50%;
height: 100%;
border-radius: 0 100% 100% 0 / 50%;
background-color: inherit;
transform-origin: left;
animation: spin 3s linear infinite, bg 6s step-end infinite;
}
@keyframes spin {
to { transform: rotate(.5turn); }
}
@keyframes bg {
50% { background: currentColor; }
}
</style>
</head>
<body>
<div class="pie"></div>
</body>
</html>
该文章在 2023/7/26 11:56:34 编辑过 |
关键字查询
相关文章
正在查询... |