使用纯css在箭头周围绘制圆圈

时间:2013-10-24 16:32:20

标签: html css css3

我有一个使用纯CSS创建的按钮。

鼠标悬停按钮时,箭头从上到下动画。我想在箭头外面创建一个圆圈。所以圆圈应该包含箭头。

我不确定是否可能。我做了一些谷歌研究,但找不到合适的东西。

<a href="#" class="button">
  <span>Hover Me</span>
</a>

小提琴是here

2 个答案:

答案 0 :(得分:8)

如果我理解你,就像这样:

.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/

答案 1 :(得分:0)

jsFiddle DEMO

.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
}
相关问题