以下可能是一种选择。
对于 HTML:
<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;
}
确保 for 的语法background-position
绝对正确,否则 Safari 将无法识别。Firefox 更宽容一些。
演示位于:http: //jsfiddle.net/audetwebdesign/GpAek/