pioneerx01 Posted November 7, 2012 Share Posted November 7, 2012 I am trying to get a simple menu to have few item next to each other in the row, but still be centered with the page. <div ID="parent"> <div ID="child">Menu Item 1</div><div ID="child">Menu Item 2</div><div ID="child">Menu Item 3</div> </div> How would I CSS that? I am having issues centering them on the page and keeping them next to each other at the same time. Thanks Link to comment https://forums.phpfreaks.com/topic/270384-center-div-within-div-and-stll-float-them/ Share on other sites More sharing options...
Volter9 Posted November 7, 2012 Share Posted November 7, 2012 To parent you're setting this properties: #parent { margin: 0 auto; /* Auto working only in W3C browsers, no IE, sorry */ } To fix it in IE, you should to wrap parent div with <table align="center"> Link to comment https://forums.phpfreaks.com/topic/270384-center-div-within-div-and-stll-float-them/#findComment-1390688 Share on other sites More sharing options...
Drongo_III Posted November 15, 2012 Share Posted November 15, 2012 I am trying to get a simple menu to have few item next to each other in the row, but still be centered with the page. <div ID="parent"> <div ID="child">Menu Item 1</div><div ID="child">Menu Item 2</div><div ID="child">Menu Item 3</div> </div> How would I CSS that? I am having issues centering them on the page and keeping them next to each other at the same time. Thanks As above. Set the parent div to be margin: 0px auto; And it most definitely does work in IE! Link to comment https://forums.phpfreaks.com/topic/270384-center-div-within-div-and-stll-float-them/#findComment-1392724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.