我得到了一個精靈圖片,這是一個麪包屑菜單。當鼠標懸停在菜單的元素上時,我想改變這個精靈的y位置。 是沒有問題的具有固定寬度的網站做到這一點,但我不能一個負責任的一個解決此...我的精靈如何響應?
下面是現場版:http://jsfiddle.net/RtqkD/ 和我的CSS代碼:
.services {
height: 64px;
width: auto;
background: transparent url('https://dl.dropboxusercontent.com/u/3894287/sprite.png') no-repeat 0 0;
background-size: 100%;
}
.services #Et1 {
margin-left: 60px;
}
.services #Et1, .services #Et2, .services #Et3, .services #Et4 {
height: 65px;
}
.services li {
float: left;
width: 210px;
position: relative;
background: none;
}
.services li a {
display: block;
padding: 8px 7px 8px 7px;
text-decoration: none;
text-align: center;
text-transform: uppercase;
}
.services li:first-child a {
padding-left: 10px;
}
任何提示?
編輯 的@Sven評論我在這裏做了我的問題的更完整的現場版本後的CSS,Java腳本HTMLand:http://jsfiddle.net/RtqkD/2/
對不起,但代碼的和平顯示什麼。你必須告訴我們什麼對你有用,以及你想要什麼,然後什麼不適合你,以及你的問題在哪裏。 –
可能這會給你一些指導:https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Scaling_background_images – Cherniv
你能描述你想在不同分辨率下使用的精靈的哪部分? – mitch