Dug Posted February 23, 2007 Share Posted February 23, 2007 Hi there,I'm trying to get the code for my website to W3C standard. The Doctype I'm using is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> The problem is that CSS positioning doesn't seem to work when I use Doctypes. It works without the Doctype though. For example, the positioning code I'm using is: position: absolute; top: 200; left: 200; This code is in the #welcome and on the page itself: <div id="welcome"> .I'm using Dreamweaver for my site. Has anyone had this problem before? If so, what's the best way to position things?ThanksDouglas Link to comment Share on other sites More sharing options...
aspnetguy Posted February 23, 2007 Share Posted February 23, 2007 try this when using the doctype. position: absolute; top: 200px; left: 200px; Link to comment Share on other sites More sharing options...
Dug Posted February 24, 2007 Author Share Posted February 24, 2007 Unfortunately it still isn't working. Is there anything else I could try?Dug Link to comment Share on other sites More sharing options...
S@m Posted February 24, 2007 Share Posted February 24, 2007 I would use xhtml 1.0 vs. html.Just a cleaner way. Why use "older" stuff when the new is better?Try this doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> Really, there isn't that much difference.*edit*make sure you use px for a unit (or at least some sort of unit) Link to comment Share on other sites More sharing options...
Dug Posted February 25, 2007 Author Share Posted February 25, 2007 Well, I managed to get it working finally. The one that seems to work is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> I was trying to get it working with the default Dreamweaver Doctypes. Don't know what went wrong.Dug Link to comment Share on other sites More sharing options...
croatiankid Posted February 26, 2007 Share Posted February 26, 2007 Unfortunately this means your page is coded in a way that it relies on browsers to be in quirks mode. http://hsivonen.iki.fi/doctype/ is a useful table where you can see which doctypes activate which rendering mode in many browsers. You'll get the same effect using <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> and no doctype. 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