Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ DOCTYPE Confusion

Posted by: a01020304 Jun 18 2009, 04:25 PM

I have changed a few things since last night, am going to try another image viewer. Only problem is it requires my site to have a DOCTYPE on my site.
I have tried all the different types of DOCTYPE but the screen goes all over the place and image/text weird.

Has anyone any suggestions?

Here is the site without DOCTYPE
http://www.virtualhunterston.eu.org/castlegate.htm

Here is the site with DOCTYPE
http://www.virtualhunterston.eu.org/castlegate%20-%20Copy1.htm


I dont want to have to do loads of code changes as over 130 pages and that will frustrate me

Posted by: Darin McGrew Jun 18 2009, 07:11 PM

I recommend that you start by fixing the markup errors and CSS errors reported by the online tools. For starters, use an XHTML doctype if you're going to use XHTML syntax, and don't use Frameset doctypes except for framesets.

http://htmlhelp.com/cgi-bin/validate.cgi?url=http%3A%2F%2Fwww.virtualhunterston.eu.org%2Fcastlegate%2520-%2520Copy1.htm&warnings=yes
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.virtualhunterston.eu.org%2Fcastlegate%2520-%2520Copy1.htm&profile=css21&usermedium=all&warning=1&lang=en

See also:
http://hsivonen.iki.fi/doctype/

Posted by: pandy Jun 19 2009, 02:03 AM

The doctype isn't the only difference. The new page has JavaScript errors. The old has not. Maybe there are other differences too. I'd look into the JS errors.

A Frameset doctype is not what you want. That's for frameset documents. You should use the doctype that corresponds to the flavour of HTML that you actually write.
http://htmlhelp.com/tools/validator/doctype.html

Those slashes you use (<br />, <img... /> and so on) are used in XHTML. If you mean to write XHTML you should use an XHTML doctype. I suggest you stick to HTML 4.01 and remove the slashes instead. It's better to wait with XHTML until you know what the difference between HTML and XHTML is and can make an educated choice about it, if you want to use XHTML or not.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)