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

Recommended Answers

All 51 Replies

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/

commented: Useful advice +3

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

commented: Very useful advice including some tips. +3

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

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

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

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

commented: A very useful post +3

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

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

commented: A very useful list of standard testing browsers +3

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

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

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...?

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

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.

im not going to use doctypes.

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 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???

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...?

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

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

You should use it because else you may get undefined behaviour. Thats why standards exist. Secondly, if its not valid, it is unlikely to be screenreadder friendly. If you dont take adequate steps to support disabled users you could risk being sued (look up the Sydney Olympics accessibility scandal).

And yes, you should have a correct document type defined or else you risk being penalised by some search engines.

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...?

Because you are wrong!
"make search engines go into "Quirks Mode" "
Search engines dont go into any kind of mode, and even if they do, who cares?!
And what's so notoriuosele bad about "quirks mode?
[It gives you more coding options than W3C ever will = qiurks means FREEDOM]

I've asked you that;
Because: html doesn't need any of what you are demanding - the Document Extension will suffice!
I remember the time when you were not allowed to write anything ( meaning nothing ) before the <HTML> tag, 'cause it would cause errors on the parser, or render as unformated as if it was a part of your page content, but more often confuse early days Servers sending a bunch of uninteligibile crap to your clients.

Watch this:
this is Google!

<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title><script>window.google={kEI:"3UH4Ssy6Np-TjAfZx6iuDg",kEXPI:"
....

and this is Google /Firefox

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mozilla Firefox Start Page</title><style>body,td,a,p,.h{font-family:arial...

this is firefox official

<!DOCTYPE HTML>
<html xml:lang="en-US" lang="en-US" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Mozilla | Firefox web browser &amp; Thunderbird email client</title>
	<script type="text/javascript">s_account="mozillaco...

Do you see the DTD anywhere near to being specified ???
The only doctype that is practically important is allready stated in your document type marked by its solid extensin, ie HTM HTML ASP PHP etc...
It is however very wise to use define the charset, but if you are not good at it it is 1000x better not to confuse the machine with wrong info.

Who tole you that rubbish? Search Engines go into Quirks Mode and I am willing to bet you on that. Obviously you no nothing of coding. I've been a web developer for 9 years how long have you...? Google it if you don't believe me. Also whats your problem?

Because you are wrong!
"make search engines go into "Quirks Mode" "
Search engines dont go into any kind of mode, and even if they do, who cares?!
And what's so notoriuosele bad about "quirks mode?
[It gives you more coding options than W3C ever will = qiurks means FREEDOM]

I've asked you that;
Because: html doesn't need any of what you are demanding - the Document Extension will suffice!
I remember the time when you were not allowed to write anything ( meaning nothing ) before the <HTML> tag, 'cause it would cause errors on the parser, or render as unformated as if it was a part of your page content, but more often confuse early days Servers sending a bunch of uninteligibile crap to your clients.

Watch this:
this is Google!

<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title><script>window.google={kEI:"3UH4Ssy6Np-TjAfZx6iuDg",kEXPI:"
....

and this is Google /Firefox

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mozilla Firefox Start Page</title><style>body,td,a,p,.h{font-family:arial...

this is firefox official

<!DOCTYPE HTML>
<html xml:lang="en-US" lang="en-US" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Mozilla | Firefox web browser &amp; Thunderbird email client</title>
	<script type="text/javascript">s_account="mozillaco...

Do you see the DTD anywhere near to being specified ???
The only doctype that is practically important is allready stated in your document type marked by its solid extensin, ie HTM HTML ASP PHP etc...
It is however very wise to use define the charset, but if you are not good at it it is 1000x better not to confuse the machine with wrong info.

Who tole you that rubbish? Search Engines go into Quirks Mode and I am willing to bet you on that. Obviously you no nothing of coding. I've been a web developer for 9 years how long have you...? Google it if you don't believe me. Also whats your problem?

Well sun, I don't mean to argue with you by stating that I code since summer 1996, but since you've asked, you do the math.

Let Search Engines go into text only-mode if you like, that's even better for you, since it would only speed things up, -but that has nothing to do with our concern here and our main concern is our client, clients!

The only thing that matters is the welllformed structure under the <html> opener until it is closed - everything else is an overhead and a potentially higher chance of causing a mess.

Rergards.

I find quirks mode causes problems it renders very differently in different browsers, and goes invisible in some.
I know the code I write works in my browser, and thumbdrive versions of other browsers.
The quickest way to find if code works is to test it in lots of browsers,
I push BrowserShots to do so, major screw ups have blankscreens, bad displays or error messages in the returned screenshots.
Valid code, gives less screwups in real browsers
Valid code with no fixed sizes for elements (ems %), except graphic elements that actually are fixed size (<img>), even display very similar in different browsers and different OS different resolutions

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

I do SEO, should i learn something about HTML and CSS?
They can help me get higher wages

im not getting suied for not using a doctype ddt. that would be an error on the person suing not me. nothing is required to make a website. u just have to make it legal. makeing a website and not adding doctypes or ddts is not illegal. noone can get sued FOR THAT.

im not getting suied for not using a doctype ddt. that would be an error on the person suing not me. nothing is required to make a website. u just have to make it legal. makeing a website and not adding doctypes or ddts is not illegal. noone can get sued FOR THAT.

http://www.tomw.net.au/2001/bat2001f.html

There is a precedent. They didnt follow the spec which made it non-screenreader friendly, thereby discriminating against the blind.

Look I understand what your saying about DOCTYPE's but they are supposed to be in coded HTML pages of a web site, Its not compolsery its just telling browsers what the document is about. You don't have to add one, however it is recommended.

commented: a few incorrect points, but mainly good points. +21

SKANK!!!!!: Refusing to use a doctype does sound like some blatant obstinacy, but hey, it's a free world. If you're happy with your websites and their performance then I don't see any particular reason that you should feel obligated to change them. I do think it's a little close-minded not to consider learning what you can about web design validity and making use of what you learn.

Changing subjects, I'll add my two bits about using HTML validation. I don't find it particularity important to make sure that my sites are 100% valid but I do find that using the validator can help me find mistakes in my code that I didn't know existed. I usually clean up the easiest things that cause validation to fail and then make a value judgment on the last and most difficult items. I usually try to determine if these last and most difficult items are likely to cause real rendering problems or Google Search Engine problems and make my decision based on that. And for your information, I generally hand-code my sites (at least the template) and I'm a pretty big fan of sticking to standards and making things valid. The only time I deviate from this is either out of ignorance or when I use experimental CSS properties which I do choose to use at times to give those who have broken away from IE an improved visual experience.

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.