2017-09-04 71 views
-3

我设计了一个号召性用语框。这个想法是添加一个圆形的形状。这个形状需要顺利滑入。有没有人有一个想法或例子如何编程?悬停时有方圆按钮的圆形按钮

Normal state on the left. On the right the hover state.

谢谢了。

阿尔扬

+2

欢迎来到StackOverflow!请提供您的尝试的[最小,完整和可验证示例](http://stackoverflow.com/help/mcve)。作为[Stack Snippet](https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/),因此我们可以尝试解决您的问题并解释原因你自己的尝试失败了 - 这样你就可以学到一些对你未来发展有用的东西,并为这个单一问题找到答案。 – andreas

回答

2

.square{ 
 
    background: #bc82ff; 
 
    width: 200px; 
 
    height: 200px; 
 
    padding: 20px; 
 
    color: white; 
 
    word-break: break-all; 
 
    position: relative; 
 
    overflow: hidden; 
 
    cursor: pointer; 
 
} 
 
.square > p{ 
 
    color: white; 
 
    position: relative; 
 
} 
 

 
.circle{ 
 
    position: absolute; 
 
    width: 300px; 
 
    height: 300px; 
 
    border-radius: 100%; 
 
    background: #a672e9; 
 
    bottom: 100%; 
 
    left: -30px; 
 
    transition: bottom 0.5s; 
 

 
} 
 
.square:hover > .circle{ 
 
    bottom: 20px; 
 
}
<div class="square"> 
 
    <span class="circle"></span> 
 
    <p>12312312312312312321321312321</p> 
 
</div>

你应该尽量表现你的努力。

参照这个。

+0

感谢您的帮助:) –