0

I want to change my doctype to XHTML but it breaks all the content in my page, how to resolve the issue..?

I'll show you what was the change I've done on my document.

from this doc

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

It causes overlapping the content throughout the site, I'm shocked :( CSS styles are working, I mean in color and font sizes, but paragraphs widen to the right side.

Can anyone tell a solution..? I'm changing the doctype because something like a floating Ad is works only in XHTML format in IE it doesn't support the HTML format that is why.

Thanks in advance!

Paul

2 Answers 2

4

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

This doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

puts your page into Quirks Mode.

Unfortunately for you, your site has been made to work with Quirks Mode enabled - this was a fatal mistake.

The only sensible thing to do is to change the doctype to one that triggers (Almost) Standards Mode (such as the XHTML doctype in your question, or simply <!DOCTYPE html>).

Then, you'll unfortunately have to go through the laborious task of fixing your site.

Doing this should help your site to render more consistently between different web browsers, and that's a worthy secondary incentive.

0
0

Unfortunately, you'll have to redesign your site completely (CSS- and design-wise). Then, sticking a standards/almost standards mode doctype (such as <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">) on your web page should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.