dunc453 Posted March 11, 2009 Report 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
Andrea Posted March 11, 2009 Report 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.
dunc453 Posted March 11, 2009 Author Report 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.
Wickham Posted March 12, 2009 Report 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:-
dunc453 Posted March 12, 2009 Author Report 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now