position: absolute
top: 0
right: 0
width: xxpx
height: xxpx
background: url(...)
这个图就能跑到右上角了,注意父div position设为relative。
html里怎样实现div左上角标注hot方法:
1、CSS部分修改:
.hot_play{ position:relative}.hot_play ul{ float:left}
.hot_play li{ float:left position:relative width:95px margin:4px 19px 16px 0overflow:hidden}
.hot_play a img{ width:86px height:120px padding:2px border:1px solid #cfcfcf}
.hot_play a:hover img{ border-color:#8ECFF9}
2、定义好图片的坐标也可以:
<img src="static/images/ghot.gif" style="position:absolutez-index:1001margin-left:380pxmargin-top:1px">.hot_play span{display:block width:35px height:34pxposition:absolute left:0px top:0px}
.hot_play span.back{ background:url(images/hot.gif) no-repeat }
3、主页部分修改:
<div class="hot_play"><ul>
<li>
<a href="/"><img src="/" alt="/"></a>
<span class="back"></span>
</li>
</ul>
</div>