我有一个使用纯 CSS 创建的按钮。
在将鼠标悬停在按钮上时,箭头会从上到下进行动画处理。我想在箭头外创建一个圆圈。所以圆圈应该包含箭头。
我不确定这是否可能。我做了一些谷歌研究,但没有找到合适的东西。
<a href="#" class="button">
<span>Hover Me</span>
</a>
小提琴在这里
如果我理解你,是这样的:
.button span:before {
content:' ';
position: absolute;
top: 0px;
right: -18px;
opacity: 0;
width: 30px;
height: 30px;
margin-top: -19px;
border-radius: 50%;
background: #000;
transition: opacity 0.2s, top 0.2s, right 0.2s;
}
演示:http: //jsfiddle.net/DFNn9/4/
.button:hover span:after, .button:active span:after {
transition: opacity 0.2s, top 0.2s, right 0.2s;
opacity: 1;
border-color: #e24500;
right: 0;
top: 62%;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: blue
}