pushing up with negative margin and stay visible
I have 2 divs in an outer div. The outer div has a top margin so there is a space above it. I want to move the left inner div a little up to fill some of that space. I did a minus margin-top.. it works, it pushes the left inner div up.. but it hides the top 10px that moved up. I want them to stay visible.
I tried making the div have z-index to the front (1) but it does not work. I want 开发者_Go百科to move the inner left div up and want the pushed up part to stay visible.
<div id="line"> //style margin-top:30px
<div id="lineleft"> //style margin-top:-10 z-index=1
</div>
<div id="lineright">
</div>
</div>
You may need to change the value of the overflow
property on the outer div.
Seems to be working here in all major browsers: http://jsfiddle.net/rBTtt/
精彩评论