<div style="list-style-type:none;width:400px" class="box">
<ul id="lastfm">
<li>...</li>
...
<li class="overlay"></li>
</ul>
</div>
li.overlay
项目,并使用CSS将背景图像附加到它:.box ul#lastfm {
padding-right: 75px;
position: relative; /* So that the absolute positioning based on this block... */
margin-left: 0;
list-style: square outside none;
}
.overlay {
outline: 1px dashed blue; /* for demo only */
position: absolute;
z-index: 1; /* to make sure it is in front of list items... */
bottom: 0;
right: 0;
height: 70px; /* will depend on your images... */
width: 110px;
background-attachment: scroll, scroll;
background-clip: border-box, border-box;
background-color: transparent;
background-image: ...
background-origin: padding-box, padding-box;
background-position: right bottom, right bottom, left 0px;
/* Make sure syntax is correct, otherwise Safari gets confused... */
background-repeat: no-repeat, no-repeat;
background-size: auto auto, 70px auto, auto auto;
}
请确保 background-position
语法完全正确,否则 Safari 将无法理解。Firefox 更加宽容一些。
z-index: -1
的答案,那个行得通吗? - Marc Audet