May 24, 200719 yr hey, ive got this bit of code that keeps my page content central when i load it onto the browser. works lovely in firefox but when i use IE the page layout goes to pot, please help. the code im using is ... <div id="tipDiv" style="position:absolute; z-index:100"></div> <div align="center"> ive had a mess around and im pretty sure that its the 'z-index:100"></div>' that is causing the problems. thanks to anyone that can help me out. d
May 24, 200719 yr <div style="width: x; margin: 0 auto;">always works for me in every browser to center my layout. </div> Wildo
May 24, 200719 yr The z-index property sets the stack order of an element. An element with greater stack order is always in front of another element with lower stack order. What makes your page centered is "margin: 0 auto;" - this basically means 0 top and bottom margins and the right and left margins are automatically set within the browsers window width - thereby making your layout central. It's always best to use this in conjunction with "text-align: center;" within your body tag.
Create an account or sign in to comment