【发布时间】:2021-01-15 19:47:36
【问题描述】:
我正在尝试使用 css(或 svg)绘制此输出。对我来说,最难的部分是圆的左右两边的半圆弧。我应该坚持纯 css 还是使用图像更好?
感谢任何帮助...
这是我设法做到的:
代码如下:
body {
background-color: #002911 !important;
}
h3 {
color: #ffd004;
}
#actions-container {
margin-top: 30px;
}
#actions-container .action-icon {
width: 200px;
height: 200px;
background-color: rgb(255, 208, 4);
border-radius: 50%;
box-shadow: 5px -2px 6px 3px #0000004a;
/* center contents*/
display: flex;
justify-content: center;
align-items: center;
}
.right-arc {
position: relative;
display: inline-block;
font-size: 30px;
color: lightgreen;
margin: 40px;
}
.right-arc::after {
content: '';
position: absolute;
right: -150px;
top: 57px;
height: 300px;
width: 300px;
border-radius: 50% 50% 50% 50%;
border-width: 0px 1px 0px 0px;
border-style: solid;
/*border-top: outset;*/
}
/*svg {
width: 33%;
height: auto;
}*/
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
<div class="container" id="actions-container">
<div class="d-flex justify-content-between">
<div class="action-icon-box text-center ">
<div class="right-arc">
</div>
<h3 class="text-center">Title</h3>
<div class="p-1 action-icon text-center mt-4">
<a href="#"><img class="center" src="/Content/images/lp-homepage/microphone.png" height="100" /></a>
</div>
</div>
</div>
</div>
【问题讨论】:
-
你也想要动画吗?或者只是圆圈
-
没有动画,只有围绕圆的两条弧线。
标签: html css svg css-shapes