Quick DocType Question

  • Joe426
  • Beginner
  • Beginner
  • User avatar
  • Posts: 59

Post 3+ Months Ago

Okay....My site - http://www.hacknmod.com has quite a few errors on ye ole w3c validator

A lot of the issues have to deal with my doctype - when i switch it to html, it says some of my xhtml tags aren't allowed. however, when i switch it to xhtml, it says my html doctypes aren't allowed. Is there some in between I can use? Or what other suggestions can you make for me? Thanks.

http://validator.w3.org/check?uri=http% ... ne&group=0
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • MrGamma
  • Beginner
  • Beginner
  • User avatar
  • Posts: 40
  • Loc: Toronto, Burlington, Hamiltion, Canada

Post 3+ Months Ago

Joe426 wrote:
Okay....My site - http://www.hacknmod.com has quite a few errors on ye ole w3c validator

A lot of the issues have to deal with my doctype - when i switch it to html, it says some of my xhtml tags aren't allowed. however, when i switch it to xhtml, it says my html doctypes aren't allowed. Is there some in between I can use? Or what other suggestions can you make for me? Thanks.

http://validator.w3.org/check?uri=http% ... ne&group=0



Try a different validator... the wc3 is not the end all be all on should be... and it certainly does not lay the rules down for what is acceptable or even possible...

http://htmlhelp.com/tools/validator/
  • Benat
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2123

Post 3+ Months Ago

Firstly take your CSS out of the document, and put it into its own file, there are a hell of a lot of errors, which are easy to fix if you know what you are looking for.

You've also defined the doco type twice, you do not need to do that.

Here.
Quote:
# Line 95, Column 8: "DOCTYPE" declaration not allowed in instance.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www


# Error Line 96, Column 42: document type does not allow element "html" here.

<html xmlns="http://www.w3.org/1999/xhtml">



The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
# Error Line 100, Column 5: document type does not allow element "body" here.

<body>



The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


Secondly, ditch the Tables layout and go with CSS. It will validate much easier.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

I'm guessing this was hacked together, keeping with the spirit of the site.

It's not going to be as easy as a DOCTYPE swap.
Biggest issue, is the one Benat pointed out. You just can't have a document within a document like that no matter what validator you use. You could place it in an <iframe> if you're using file_get_contents to place the newegg document like that. Possibly even screen the unwanted bits out.

After that, you should go with an HTML 4.01 Transitional DOCTYPE. It's going to agree with most of your layout. After that it's just ironing out wrinkles like extra "/" characters, missing ALT attributes on <img> elements, and some other easy to fix stuff.


Unless you plan on doing somthing more [read:enhancing] with the current layout, you can probably get away with leaving it how it is, minus the document-within-a-document newegg part.
  • Joe426
  • Beginner
  • Beginner
  • User avatar
  • Posts: 59

Post 3+ Months Ago

Quote:
with the current layout, you can probably get away with leaving it how it is


So...Google won't hate me eh? - I ditched the 2nd doctype, thx for pointing that out. I need to take the css out as well.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

Joe426 wrote:
So...Google won't hate me eh?


It won't hate you, just the way it works it might not rank you the highest... but that depends on what kind of errors you got... some errors you can go by with having and search engines won't have problems with them. If you would want me to explain specify... I'm feeling lazy right now... I'll just post a link to a log of mine where I posted something about that...

http://wedevoy.blogspot.com/2007/11/val ... sites.html

Also, remember that bots and spiders (things used by search engines to index sites...) are not humans and don't think like humans... they think how they are designed to think by their makers.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Joe426 wrote:
So...Google won't hate me eh?


Google isn't going to hate you because your site doesn't validate. But whoever has to make modifications to the site later on might.


One thing you need to remember is that Google reacts to the usefull web, the usefull web doesn't react to Google.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 52 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.