圖像背景位置爲50%左側居中背景圖像但絕對定位元素剩下50%不居中div元素爲什麼?圖像背景位置以50%爲背景圖像居中,但定位元素不爲
下面是代碼:
<div style="position:relative;height:100px; background:url(images/demo.jpg) no-repeat 50% 0">
<div style="min-height:40px; width:140px; background-color:#aaa;position:absolute;top:0;left:50%;">
heloo this is just a demo
</div>
</div>
運行這段代碼!
告訴我們代碼 – Toping 2013-02-26 11:20:05
我加了我的代碼 – 2013-02-26 16:02:47