我有这种纽托尼边界的估算,在纽托尼没有四舍五入时,这种估算是正确的。 如果纽特州有9px的边境半径,我如何能够发挥同样的作用。 如果我没有在正确的边界上打断,我就无法得到正确工作的愿望。
body {
font-family: sans-serif;
background-color: black;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.button {
position: relative;
width: 200px;
height: 40px;
background-color: #083a65;
border: none;
color: white;
font-size: 18px;
border-radius: 10px;
}
.button::before {
content: "";
position: absolute;
left: 0;
top: 0;
width: 0;
height: 0;
border-radius: 10px;
border-top: 1px solid yellow;
border-right: 1px solid yellow;
animation: border-top-right-animation 2s infinite;
}
.button::after {
content: "";
position: absolute;
right: 0px;
bottom: 0px;
width: 0;
height: 0;
border-radius: 10px;
border-left: 1px solid yellow;
border-bottom: 1px solid yellow;
animation: border-bottom-left-animation 2s infinite;
}
@keyframes border-top-right-animation {
0% {
width: 0px;
height: 0px;
}
25% {
width: 100%;
height: 0px;
}
50% {
width: 100%;
height: 100%;
}
100% {
width: 100%;
height: 100%;
}
}
@keyframes border-bottom-left-animation {
0% {
width: 0px;
height: 0px;
opacity: 0;
}
50% {
width: 0px;
height: 0px;
opacity: 0;
}
50.1% {
width: 0px;
height: 0px;
opacity: 1;
}
75% {
width: 100%;
height: 0px;
opacity: 1;
}
100% {
width: 100%;
height: 100%;
opacity: 1;
}
}
<button class="button">My button</button>