是否可以用两种颜色制作圆角和虚线的div边框,如果是,如何?半径不同颜色的css边框
现在我所做的是:
.container{
position: relative;
width: 100%;
height: 100vh;
}
.years {
display: block;
position: absolute;
width: 50px;
height: 0px;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
background: #1c1e2e;
z-index: 999;
border-radius: 100%;
text-align: center;
padding: 60px 30px;
}
.years:before {
content: '';
position: absolute;
width: 140px;
height: 155px;
top: -17px;
left: -17px;
border-radius: 100%;
border-right: 3px dotted #000;
border-top-left-radius: 100%;
border-bottom-left-radius: 100%;
}
.years:after {
content: '';
position: absolute;
width: 140px;
height: 155px;
top: -17px;
left: -17px;
border-radius: 100%;
border-left: 3px dotted #dfbc82;
border-top-left-radius: 100%;
border-bottom-left-radius: 100%;
}
<div class="container">
<div class="years"></div>
</div>
没有任何smoothiness,并不能弄清楚如何使打印屏幕上的正常点... 任何想法?欣赏任何建议..:/
我喜欢你的代码,但在顶部和底部的边界点更薄比在两边.. – Scorpioniz
@Scorpioniz你是对的!我犯了一个错误,它错过了其他角落,所以我让它透明。再次检查 –
是的!这正是我所需要的.. :)用@james回答一些代码的课程!伤心,我不能投票2答案:/ /但你是更正确的:) – Scorpioniz