Fin*_*nnn 5 html css css3 css-animations
我试图在纯css中重新创建以下gif -
Css在这里 - http://codepen.io/anon/pen/FmCaL - (只在mo的webkit/chrome)
我试图通过使用前后psuedo选择器重新创建丢失的圆圈块,但我无法正确地获得角度.
它甚至可以吗?有更好的方法吗?
感谢您的帮助到目前为止.我应该指明我需要箭头是透明的.我不能使用纯色作为圆圈的缺失部分.
简单地这样做怎么样?
div {
border: 10px solid #000;
height: 50px;
width: 50px;
border-radius: 50%;
position: relative;
}
div:after {
height: 0;
width: 0;
display: block;
position: absolute;
right: -12px;
content: " ";
border-bottom: 12px solid #fff;
border-right: 12px solid transparent;
transform: rotate(10deg);
}
Run Code Online (Sandbox Code Playgroud)
说明:我们在这里做的是使用:after
伪将元素绝对定位到圆并使用transform
属性来旋转三角形.
演示2(带动画)
div {
border: 10px solid #000;
height: 50px;
width: 50px;
border-radius: 50%;
position: relative;
animation: spin 1s infinite linear;
}
div:after {
height: 0;
width: 0;
display: block;
position: absolute;
right: -12px;
content: " ";
border-bottom: 12px solid #fff;
border-right: 12px solid transparent;
transform: rotate(10deg);
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
Run Code Online (Sandbox Code Playgroud)
我的建议:当你更新你的qustion,你说你想要一个透明的排水沟,我建议你使用一个.png
图像并旋转它,而不是写100行CSS并担心跨浏览器的兼容性.或者,当我在评论中共享链接时,您可以使用CSS屏蔽.