图像背景位置为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