954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

HTML Validation why bother?

Hi
I am using Expression Web 2 and need to alter an existing website so as to display nicely on what I regard as a standard display size of 1024 x 768. It would have been better to start from scratch but it's a bit late for that now. I have an error "td tag not closed before this body tag closed". I couldn't find any open tags and decided to sumbit the page to the HTML validator. To cut a long story short it didn't accept the Doctype statement throwing 9 errors.

Just out of curiousity I decided to enter www.microsoft.com into the validator. Is this a record? The validator threw up 296 errors and 31 warnings!

Microsoft seem to be doing all right so why bother should we bother with the HTML validator?

Geoff

ggeoff
Junior Poster
171 posts since Aug 2007
Reputation Points: 6
Solved Threads: 0
 

Here's what W3 says on the subject: http://validator.w3.org/docs/why.html

Personally, I'm not totally convinced that validating is that big of a deal; it's certainly a good gauge of how your site may perform in a multi browser environment, but if your HTML doesn't validate, and you're happy with the way your site is being rendered in all of your test cases, then it's probably ok.

All that being said, if a validator isn't recognizing your doctype, I'd think that's an indication that your site has a good chance of not rendering properly in some browsers...I'd double check your doctype against this chart: http://hsivonen.iki.fi/doctype/

scottloway
Junior Poster in Training
55 posts since May 2008
Reputation Points: 22
Solved Threads: 12
 

I'm very big on valid coding myself but always feel that if your happy with your web sites errors and warnings then don't worry. However, if it didn't recognise your DOCTYPE then chances are that browsers might not and then place your website into "Quirks Mode" which is not a good thing. Its bad for displaying your site and also SEO can be effected. To be honest why don't you just copy/paste your code in a direct input? If the html document isn't working try that. It might just be a bug. What DOCTYPE are you using by the way? Some DOCTYPES aren't used anymore if its that old, theres a simple answer to that, change your DOCTYPE to a valid one then re-submit your file for validation. However it may cause more errors and warnings.

Goodluck...!

Wrams
Newbie Poster
22 posts since Nov 2008
Reputation Points: 28
Solved Threads: 1
 

Here's what W3 says on the subject: http://validator.w3.org/docs/why.html

Personally, I'm not totally convinced that validating is that big of a deal; it's certainly a good gauge of how your site may perform in a multi browser environment, but if your HTML doesn't validate, and you're happy with the way your site is being rendered in all of your test cases, then it's probably ok.

All that being said, if a validator isn't recognizing your doctype, I'd think that's an indication that your site has a good chance of not rendering properly in some browsers...I'd double check your doctype against this chart: http://hsivonen.iki.fi/doctype/


Thanks for the tip scottloway

Geoff

ggeoff
Junior Poster
171 posts since Aug 2007
Reputation Points: 6
Solved Threads: 0
 

I'm very big on valid coding myself but always feel that if your happy with your web sites errors and warnings then don't worry. However, if it didn't recognise your DOCTYPE then chances are that browsers might not and then place your website into "Quirks Mode" which is not a good thing. Its bad for displaying your site and also SEO can be effected. To be honest why don't you just copy/paste your code in a direct input? If the html document isn't working try that. It might just be a bug. What DOCTYPE are you using by the way? Some DOCTYPES aren't used anymore if its that old, theres a simple answer to that, change your DOCTYPE to a valid one then re-submit your file for validation. However it may cause more errors and warnings.

Goodluck...!


Thanks Wrams The HMTL statement was above the doctype. I created a blank document in Expression web selecting 4.01 transitional and presented that it worked fine
Geoff

ggeoff
Junior Poster
171 posts since Aug 2007
Reputation Points: 6
Solved Threads: 0
 

Glad to here it sorted your problem out. Any more help needed just post and I will be glad to assist. ;)

Wrams
Newbie Poster
22 posts since Nov 2008
Reputation Points: 28
Solved Threads: 1
 

Hi I am using Expression Web 2 and need to alter an existing website so as to display nicely on what I regard as a standard display size of 1024 x 768. It would have been better to start from scratch but it's a bit late for that now. I have an error "td tag not closed before this body tag closed". I couldn't find any open tags and decided to sumbit the page to the HTML validator. To cut a long story short it didn't accept the Doctype statement throwing 9 errors.

Just out of curiousity I decided to enter www.microsoft.com into the validator. Is this a record? The validator threw up 296 errors and 31 warnings!

Microsoft seem to be doing all right so why bother should we bother with the HTML validator?

Geoff


The HTML online validator can't tell where the arror ocurred exactly. Tries to narrow the posibility by selecting the first element the error triggered and the last one suffering it. In this case, the closing tag of the body element. This means that the error has safetly passed from element to another without causing a chain error reaction until it reached the end of the document. Therefore logically you should look from the head-tail direction to try and trace it. In fact it is most probably nothing, not even a missing closing tag, It migt be some mismatched quote or accidentaly deleted or forgoten qoute in some value most probably at that td element or right after it for that matter.
To some extend W3C validator is good for detecting malformed markup in time and before you've started messing up the styles to correct things that otherwise would not need fix, and which by the time you've corrected display forcedy in one browser it might just totally break it on the other because of different error recovery methods used by another and so on...

The only thing that matters is an answer to the question: does the page layout render properly and as intended on at least 3 major browers, or not? The other part is easy tweaks and commodity. Nothing else matters. Since W3C is not a browser, and w3c is not going to render those pages to you clients. A real life browsers are going to do that. They are the only standards a professional coder should follow. Since your client is not going to ask: "does your code validate at W3Cs", but "why is this table rendering halfway out of the window?!!" And believe me, I've seen so many pages passing validation completely, but rendering as an accident bare survivors.

Regards

Troy III
Practically a Master Poster
609 posts since Jun 2008
Reputation Points: 120
Solved Threads: 80
 

The HTML online validator can't tell where the arror ocurred exactly. Tries to narrow the posibility by selecting the first element the error triggered and the last one suffering it. In this case, the closing tag of the body element. This means that the error has safetly passed from element to another without causing a chain error reaction until it reached the end of the document. Therefore logically you should look from the head-tail direction to try and trace it. In fact it is most probably nothing, not even a missing closing tag, It migt be some mismatched quote or accidentaly deleted or forgoten qoute in some value most probably at that td element or right after it for that matter. To some extend W3C validator is good for detecting malformed markup in time and before you've started messing up the styles to correct things that otherwise would not need fix, and which by the time you've corrected display forcedy in one browser it might just totally break it on the other because of different error recovery methods used by another and so on...

The only thing that matters is an answer to the question: does the page layout render properly and as intended on at least 3 major browers, or not? The other part is easy tweaks and commodity. Nothing else matters. Since W3C is not a browser, and w3c is not going to render those pages to you clients. A real life browsers are going to do that. They are the only standards a professional coder should follow. Since your client is not going to ask: "does your code validate at W3Cs", but "why is this table rendering halfway out of the window?!!" And believe me, I've seen so many pages passing validation completely, but rendering as an accident bare survivors.

Regards


Thanks Troy thats a very useful insight into the way we should respond to the validator. I was trapped into looking for an unclosed TD tag when the error was an unclosed Table tag!

Geoff

ggeoff
Junior Poster
171 posts since Aug 2007
Reputation Points: 6
Solved Threads: 0
 

Q&D validation,
run the site through http://www.browsershots.org in browsers for each OS
IF w3c html validation errors are egregious it will show blankscreens in some (or many, sometimes ya really mess up :) ) browsers
if the site displays right in the target browsers, the html/css errors dont matter so much

Standard test beds
http://websiteoptimization.com/services/analyze/ Speed tweaks
http://validator.w3.org/ html check
http://jigsaw.w3.org/css-validator/ css check
http://demo.opera-mini.net/demo.html?www.yoursite.com handheld
http://www.browsershots.org other browsers

many problems (if present) will show

almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

Thanks almostbob.
A very useful list! I copied them to Outlook Notes to make it easy to access the websites.

ggeoff
Junior Poster
171 posts since Aug 2007
Reputation Points: 6
Solved Threads: 0
 

the only thing on the websites that need to be validated are feeds.

SKANK!!!!!
Posting Pro in Training
429 posts since Apr 2009
Reputation Points: 15
Solved Threads: 7
 
the only thing on the websites that need to be validated are feeds.

Who told you that crap...? I've never heared anyone say that in all the years i've been hand coding web sites so I don't know where you got that info from...?

Wrams
Newbie Poster
22 posts since Nov 2008
Reputation Points: 28
Solved Threads: 1
 

validating is no biggie i mean my site doesnt even have doc types on any of the pages except like 2

SKANK!!!!!
Posting Pro in Training
429 posts since Apr 2009
Reputation Points: 15
Solved Threads: 7
 

Then you need to add DOCTYPE's because your forcing your website into "Quirks Mode" which is very bad for websites and SEO. How can a browser recognise your web page when it doesn't understand what type of document it is...? Find yourself a DOCTYPE and insert it into all pages and watch as more of your web site becomes indexed better.

I make all my websites with Valid XHTML 1.0 Strict coding and Valid CSS 2 because CSS 3 isn't finished completely yet so they are constantly making changes to it.

If you want a DOCTYPE I can give you one...

<!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">


Insert this into every web page.

Wrams
Newbie Poster
22 posts since Nov 2008
Reputation Points: 28
Solved Threads: 1
 

im not going to use doctypes.

SKANK!!!!!
Posting Pro in Training
429 posts since Apr 2009
Reputation Points: 15
Solved Threads: 7
 

Do you realise that if you don't use DOCTYPE's its bad for your website...?

Do you mind if I ask why you don't want to use them...?

Wrams
Newbie Poster
22 posts since Nov 2008
Reputation Points: 28
Solved Threads: 1
 

Do you realise that if you don't use DOCTYPE's its bad for your website...?

Do you mind if I ask why you don't want to use them...?

Do you mind if I ask you:
Why do you Insist on him that he should use them anyway???

Troy III
Practically a Master Poster
609 posts since Jun 2008
Reputation Points: 120
Solved Threads: 80
 

I'm simply letting him know that its bad for your web site thats all. No Doctype will make search engines go into "Quirks Mode" which will effect the site in general. I'm NOT insisting he uses it I am giving him some friendly advice to help him and his web site out.

Why, do you think I am wrong giving him some advice...?

Wrams
Newbie Poster
22 posts since Nov 2008
Reputation Points: 28
Solved Threads: 1
 

im a female. i dont want to use them because they make no sense and are ahassel. my website isnt bad at all

SKANK!!!!!
Posting Pro in Training
429 posts since Apr 2009
Reputation Points: 15
Solved Threads: 7
 

I was just trying to give you advise thats all. Because I thought you wanted to learn XHTML and CSS. My mistake!!

Wrams
Newbie Poster
22 posts since Nov 2008
Reputation Points: 28
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You