Forum Moderators: open

Message Too Old, No Replies

Using XHTML with an HTML doctype

         

chadmg

7:31 pm on Jul 7, 2004 (gmt 0)

10+ Year Member



Are there any problems using XHTML with an HTML doctype? Are there any known problems in any browser with this? I have a rather large site that is currently using an HTML 4 Transitional doctype. This site was set up using ssi and I would like to change any pages I make in the future to use XHTML in the content area of the site. All of my pages look similar to the following...

<? require("top.php")?>
<p>Main content<br />area here</p>
<? require("bottom.php")?>

The dtd is set in top.php. I can't change the dtd for all of my pages currently because it effects the layout of old pages. If I make future pages in XHTML I would eventually be able to replace old pages with XHTML and change the doctype. But I would first like to know if any browsers will not display xhtml correctly with an html doctype. Thanks.

encyclo

7:37 pm on Jul 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are unlikely to have any display problems, but the page may no longer validate. Previously, the W3 validator let this kind of thing go through, but the parsing has been tightened up in the last release. If that is acceptable to you, then go ahead.

Personally, though, I'd concentrate on switching the whole site to valid HTML 4.01 Transitional first, then HTML 4.01 Strict, and then handle a transition to XHTML later on if you feel it is necessary.