CSS relative属性之霸气外露实例页面

代码:

CSS代码:
.box { margin:2em; width:15em; height:8em; background-color:#beceeb; }
.box img { margin-top:-3em; *zoom:1; }
                
HTML代码:
<div class="box">
    <img id="target" src="//image.zhangxinxu.com/image/study/s/s128/mm3.jpg" />
</div>
<p><input type="button" id="button" value="点击图片应用position:relative" /></p>
                
JS代码:
$("#button").click(function() {
    $("#target").css("position", "relative");	
});
                

效果: