3

所以我想准确地重新创建丝带过渡http://subtlepatterns.com/但我做错了。我的功能区图像是 140x160 [width,height] 但悬停没有任何反应。

我放:

#toplogo {
    position: absolute;
    left: 400px;
    background-position: 0px -10px;
    z-index: 5000;
}


#toplogo a {
    background: url('ribbon.png') no-repeat;
    width: 140px;
    height: 160px;
    display: block;
    background-position: 0px -10px;
    text-indent: -9999px;
    -webkit-transition: 0.10s ease-in;
    -moz-transition: 0.10s ease-in;
}



<div id="toplogo"> <a href="/">hello</a> </div>
4

2 回答 2

2

在 CSS 中添加这个 -

#toplogo a:hover{
  background-position: 0px 0px;
}
于 2012-06-15T11:58:59.827 回答
1

尝试

#toplogo a {
    background: url('ribbon.png') no-repeat;
    width: 140px;
    height: 160px;
    display: block;
    background-position: 0px -10px;
    text-indent: -9999px;
    -webkit-transition: background-position .1s ease-in;
    -moz-transition: background-position .1s ease-in;
}

#toplogo a:hover {
  background-position: 0 0;
}
于 2012-06-15T13:16:27.783 回答