Forum Moderators: open

Message Too Old, No Replies

Proper Doctype Code and Extra HTML Tag on Page

         

frenzy77

1:18 pm on Jul 13, 2009 (gmt 0)

10+ Year Member


Hi guys:)

Need some help please.
Well, when i add the doc type to a site,

Q1. do i need to also add an *Extra* <html> tag after the
<html xmlns="http://www.w3.org/1999/xhtml"> part?

Like this:

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

<html>
<head>

Or do i Not add that Extra <html> tag in?

I ask because i'm not sure if we are supposed to enter it in *Also* or if the first one covers the start of the html for the content of the webpage. I want to be sure the page displays correctly:)

Q2. Is it ok to leave the Extra <html> tag In as it is shown above and will it be ok?

Thanks guys for the help:)
frenzy

encyclo

4:43 pm on Jul 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You just need one
html
opening tag, not two. The page will almost certainly display with two tags, but it will be invalid HTML.

swa66

11:14 pm on Jul 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Considering you're using xhtml, I'd strongly suggest to make 100% to only have valid xml.

So, you need to loose the <html> and keep the html element with the xml namespace attribute.

[validator.w3.org...] usually will help you with these although its errors aren't always as easy to understand as they could be.