Welcome to WebmasterWorld Guest from 18.207.238.169

Forum Moderators: open

Message Too Old, No Replies

Proper Doctype Code and Extra HTML Tag on Page

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

Full Member

10+ Year Member

joined:May 3, 2004
posts:316
votes: 0

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

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

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9074
votes: 6


You just need one
html
opening tag, not two. The page will almost certainly display with two tags, but it will be invalid HTML.
11:14 pm on July 13, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 7, 2003
posts:4783
votes: 0


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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members