1、css样式
.photoX{ margin: 5px; width: 300px; height: 200px; border:1px solid #5df; } .rubbish{ width:32px; height:32px; position:absolute; z-index: 10; left: 270px; top: 10px; cursor:pointer; }
<div style="float:left; position: relative;"> <img id="photoX3" class="photoX" src="/hospital1/tool/getImage.jsp?filePath=basePathzyj_196/f6c8b20a-2ba1-4ec6-a6b2-cbcc787fd95c.png" style="border: 1px solid rgb(85, 221, 255);"> <img id="rubbish_photoX3" onclick="deletePhoto('basePathzyj_196/f6c8b20a-2ba1-4ec6-a6b2-cbcc787fd95c.png','photoX3')" src="/hospital1/icons/rubbish.png" class="rubbish" title="删除"> </div>
原文地址:http://blog.csdn.net/class_horse/article/details/44463267