Forum Moderators: open

Message Too Old, No Replies

Adding DOCTYPE to an ASP file

         

Lyndsay

6:49 pm on Jan 3, 2006 (gmt 0)

10+ Year Member



So today I ran a validator on the home page of one of the sites I do SEO for.

haha, yup, no doctype found. Now, okay, I'm not the Webmaster so I guess it's not my responsibility, but I can't stand messy code so I want to fix this.

The first chunk of the page is all ASP. The <html> tag doesn't even occur until line 203.

Soooooooo does the DOCTYPE tag go on line one? Or line 202?

monkeythumpa

7:07 pm on Jan 3, 2006 (gmt 0)

10+ Year Member



It can go on any line before the "<html>" tag. Just don't put it in any ASP code that might hide it. Basically, I would either put it as the first line of code or the line immediately before the "<html>" tag depending on the code.

You might benefit from breaking up the file into three includes, a CSS file, a layout file, and a logic file.

drhowarddrfine

7:14 pm on Jan 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It can go on any line before the "<html>" tag.
No. It is to be the first line. If anything is placed before that, IE will be in quirks mode while all others will, properly, go to standards mode.

encyclo

8:04 pm on Jan 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is to be the first line.

It has to be on the first line of the outputted file, ie. the generated page. If when you view the page now the

<html>
tag is on the very first line, then you can add the doctype just before that in the ASP code.