Member Avatar for Member #36984

It is surprising that so many pages from professional companies are invalid!

For example, GOOGLE is not valid HTML 4.0.1 Tramsitional, and a DOCTYPE fallback comes into effect because they haven't correctly coded their page.

Surprising.

Can anyone else find any like this??

PS my website isn't because I am working on repairing it at the moment ! :lol:

Dani AI

Generated

A short, practical note that ties the thread together and offers concrete fixes.

is right to be surprised — many professional sites fail strict validator checks — and is also right that visible cross‑browser functionality is the usual priority. That said, validator failures often signal structural problems that matter later: broken DOM parsing, accessibility issues, or fragile CSS/JS assumptions. ’s bandwidth point explains one real trade‑off, but bandwidth-saving should be done with minification and compression, not by leaving the document structurally broken.

A common concrete cause (the situation described) is assembling a page from multiple server includes where both pieces contain full document wrappers. The assembled output then has duplicate document roots and cannot validate. Practical remedies:

  • Make the rendered page the single source of truth: keep DOCTYPE and the document‑level wrapper in one master template; turn header/footer includes into fragments (head metadata, nav, footer markup only).
  • If refactoring isn’t immediately possible, validate the final rendered HTML (view‑source or curl the page) rather than the fragments.
  • Check for stray bytes before the DOCTYPE (BOM or whitespace), mismatched character encodings, and duplicate IDs or improperly nested elements — those are frequent validator failures.

Quick checklist to make validation practical: fetch the assembled HTML and run it through a validator; confirm exactly one DOCTYPE and one root element; remove leading BOM/whitespace; adopt a simple templating/layout pattern so includes never carry full document wrappers; add automated validation to the build/CI pipeline if a policy requires a pass. Validators are tools, not dogma — they should guide fixes to structural markup while real‑world testing ensures functional compatibility.

Recommended Answers

All 3 Replies

Who cares about the W3 Standars? Geeks who have nothing better to do with their time...

I'm being very serious here, follow the W3 Standards, but do not believe it to be the word of god.

I could spend a few months aruging, but the fact is, if your website, looks and works the same in every browser, It wouldn't matter if you had millions of errors.

You know I agree with Zachery fully, but unfortunately my job required that all our pages pass the W3c validator and I tell you, I wish I had too much time on my hands.

My big problem right now is a PHP site that calls a header page as an include which contains <HTML>, <head><body> tags

as does the content of the page also has <HTML><head> and <body> tags. Validating seems impossible at this point.

Does anyone have any experience with this type of thing, were a php page combines multiple html pages?

Any insight or clues would be greatly appreciated.

commented: Cool idea opening 3 years old post -2

Code to standard from the ground up dottomm, enless your using an off the shelf cms, then you deserve the headaches you are getting rather than getting it done properly in the first place.

source forge is not vaild, and some of the w3c pages are not either.

I think google is not valid to save bandwidth, they know it will work in all browsers so why have the extra few bytes. It's viewed by billions of people, that translates into terrabytes of bandwidth and thats not cheap.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.