dennylin93 Posted January 21, 2007 Share Posted January 21, 2007 I converted a website to XHTML 1.0 Strict, but the problem is that I cannot align tables with HTML code anymore. How can I do it with CSS? Link to comment Share on other sites More sharing options...
Anders Moen Posted January 21, 2007 Share Posted January 21, 2007 You can use this; XHTML:<div id="some_name">All your content :)</div>CSS:#some_name {width: 600px;margin: 0 auto;} But to make this work in all browser, you have to use the doctype if you don't have it Link to comment Share on other sites More sharing options...
dennylin93 Posted January 21, 2007 Author Share Posted January 21, 2007 Thanks. I found out that I can also use % in CSS: table.class { width: 50%; margin: 0 auto;} Link to comment Share on other sites More sharing options...
Anders Moen Posted January 21, 2007 Share Posted January 21, 2007 Yep, that's correct Link to comment Share on other sites More sharing options...
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