biggieuk Posted February 12, 2010 Share Posted February 12, 2010 Hi all, I am trying to do what is normally a simple task of positioning a 'position:absolute' div over a 'position:relative' div containing and img tag. Here is a (amazingly drawn) sample of what it looks like in all modern browsers but IE7: In IE7 the green box for some reason is behind the big grey banner? here is my css: #green_box { background:url(images/layout/business-card.png) no-repeat; width:363px; height:190px; text-indent:-1000em; position:absolute; margin:17px 0 0 29px; z-index:999; } /********** Feature Box **********/ #grey_container { position:relative; width:947px; margin:34px auto 0 auto; z-index: 0; } a.arrow_left { position:absolute; z-index:2; left: 20px; top: 89px; width: 21px; height: 38px; text-decoration: none; background:url(images/feature/arrow-left.png); } a.arrow_right { position:absolute; z-index:2; right: 20px; top: 89px; width: 21px; height: 38px; text-decoration: none; background:url(images/feature/arrow-right.png); } The grey box html is as follows: <div id="grey_container"> <a href="#" class="arrow_left" title="Previous"></a> <a href="#" class="arrow_right" title="Next"></a> <img src="images/feature/banner.jpg" height="214" width="947" alt="Banner" /> <div id="navi"></div> </div><!-- grey_container --> Any ideas? Im going mad. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/191839-ie7-relative-positions-over-absolute/ Share on other sites More sharing options...
haku Posted February 12, 2010 Share Posted February 12, 2010 Need more HTML. Quote Link to comment https://forums.phpfreaks.com/topic/191839-ie7-relative-positions-over-absolute/#findComment-1011354 Share on other sites More sharing options...
simcoweb Posted February 12, 2010 Share Posted February 12, 2010 I've never used text-indent: to position blocks. Try using the usual top: Xpx; left: Ypx; right: Zpx; instead. IE is less likely to be corn-fuzed by the method you're using. The top, right, left, etc. commands work for positioning a box within it's relative box. Quote Link to comment https://forums.phpfreaks.com/topic/191839-ie7-relative-positions-over-absolute/#findComment-1011446 Share on other sites More sharing options...
haku Posted February 13, 2010 Share Posted February 13, 2010 He's not positioning the block with text-indent, just the text inside of it. Quote Link to comment https://forums.phpfreaks.com/topic/191839-ie7-relative-positions-over-absolute/#findComment-1011783 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.