Click to See Complete Forum and Search --> : Anomalies with XHTML DOCTYPE in MSIE 6


jorrrge
August 28th, 2002, 11:29 AM
I'm experiencing some funky anomalies with Web pages in which I use any of the XHTML DOCTYPE tags. For example, when the first line of a Web page is (all on one line):

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

a number of elements that used to work stop functioning. First, a simple JavaScript chaser script that makes a block of text remain on the screen when the viewer scrolls the page stops working. Second, the CSS settings that change the color of the scrollbar stop working.

If I simply remove the DOCTYPE tag, these elements function properly again. However, an XHTML document should begin with the DOCTYPE tag. By the way, the rest of the elements on the page adhere to the XHTML 1.0 transitional DTD requirements.

I have duplicated this on a number of systems running MSIE 6.

Thanks in advance for any observations or suggestions.

jorrrge
August 30th, 2002, 08:40 AM
The problem is that the DOCTYPE tag is supposed to be the SECOND line of the document, not the first. The first line should be an XML declaration, such as <?xml version="1.0"?>. Omitting the XML declaration seems to throw off MSIE.