dunc453 Posted March 11, 2009 Report Share Posted March 11, 2009 (edited) Hey Im having some problems with Div ID containers. http://www.ictkix.com/dlewis/externalsites/index.html If you look at that in opera or safari the container works and it is displayed in the middle. But in IE and Mozilla the container clearly doesnt work. This is the section of CSS that contains it: #first_container { margin: 0 auto 0 auto; display: table; height: 100%; position: relative; overflow: hidden; width: 660px; } And the HTML: Any help is much appreciated Regards Duncan CONTENT CONTENT id="first_container"> Edited March 11, 2009 by dunc453 Quote Link to comment Share on other sites More sharing options...
Andrea Posted March 11, 2009 Report Share Posted March 11, 2009 It's centered in Firefox. But where is your (HTML 4.01 strict) doctype? And tables are for tabular data, not layout. Add the doctype, then make sure everything validates. Quote Link to comment Share on other sites More sharing options...
dunc453 Posted March 11, 2009 Author Report Share Posted March 11, 2009 Hmm thats odd, I swear i put the doctype in lol. It doesnt validate. I will fix those and get back to you. Quote Link to comment Share on other sites More sharing options...
Wickham Posted March 12, 2009 Report Share Posted March 12, 2009 This code should center the div when you have a doctype because it has a width and side margins auto:- #first_container { margin: 0 auto 0 auto; display: table; height: 100%; position: relative; overflow: hidden; width: 660px; } This code align="center" is old-fashioned; you should use an id or class with a width and side margins auto:- Quote Link to comment Share on other sites More sharing options...
dunc453 Posted March 12, 2009 Author Report Share Posted March 12, 2009 Thanks very much Thelma and Wickham. The combination of your help has fixed it Will post if i encounter any more problems. Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.