【发布时间】:2017-12-15 09:50:18
【问题描述】:
我想在我的链接背景上实现一个简单的过渡,即图像,这样当我悬停它时,背景图像应该会旋转一点。
这是我有的,但它不起作用:
<div class="vegetable"><a href="#">link</a></div>
.vegetable a {
background: url(../img/icons/carrot.png) no-repeat ;
padding-left: 40px;
color: #fff;
font-size: 2em;
line-height: 42px;
background-size: 32px;
width: auto;
/* Firefox */
-moz-transition: all 1s ease;
/* WebKit */
-webkit-transition: all 1s ease;
/* Opera */
-o-transition: all 1s ease;
/* Standard */
transition: all 1s ease;
}
.vegetable a:hover {
/* Firefox */
-moz-transform: scale(1.1) rotate(30deg) translate(-5px);
/* WebKit */
-webkit-transform: scale(1.1) rotate(30deg) translate(-5px);
/* Opera */
-o-transform: scale(1.1) rotate(30deg) translate(-5px);
/* Standard */
transform: scale(1.1) rotate(30deg) translate(-5px);
}
【问题讨论】:
-
我们可以有 HTML
-
我已经更新了,希望对你有帮助
-
先生,请检查您所需的answer here
标签: css