Solved

Help please with W3C validation errors!!

Posted on 2015-01-04
25
159 Views
Last Modified: 2015-01-05
I am revamping my website and the moment and have ran through the homepage which has 181 errors and 1 warning.

I went through similar pages on the site and all contained less errors and found one wirg 19 errors that I have whittled down to 14, but need some help to get this to 0.

Once I have done this, I can use this as the basis for rebuilding the other pages.
The errors are repeated several times and the first four are:

Validation Output: 14 Errors
1.       Line 16, Column 35: required attribute "TYPE" not specified
type="text/javascript" for <script>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
2.       Line 30, Column 7: end tag for element "HEAD" which is not open
</head>

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.
If this error occurred in a script section of your document, you should probably read this FAQ entry.
3.       Line 32, Column 63: document type does not allow element "TABLE" here
<table width="100%" border="0" cellspacing="0" cellpadding="0">

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).
4.       Line 34, Column 97: required attribute "ALT" not specified
…th="194" valign="top"><img src="images/logo.jpg" width="250" height="165"></td>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.



First Four Errors
Error no. 1 - I have changed the text as suggested, but still get the same error message.
Error no. 2 – This claims I am closing “head” which is not open, but I can see the open on line 2 and no other head reference until closing it.  
Error no. 3 – Could this be a result of error no. 2?
Error no. 4 – I don’t really understand this

I have attached the code lines 1 to 34.
Code-from-line-1-to-34.docx
0
Comment
Question by:bill2013
  • 11
  • 7
  • 6
  • +1
25 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40530032
This version of your code validates just fine after a correcting the 'type' and the 'alt'.  It is much easier for us to help you if you put your code in the 'code' box like below rather than putting it in a 'docx' document that must be opened by another program.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
<meta name="keywords" content="network support, installation, network, networks, networking, specialists, Warwickshire, Staffordshire, Birmingham, installation and support, IT networking">
<meta name="copyright" content="2004 xxxxxxxxxxxxxxxxxxxx.  All rights reserved.  Duplication of any content on this site is prohibited.">
<meta name="designers" content="xxxxxxxxxxxx.com">
<meta name="robots" content="all">
<meta name="revisit-after" content="7 days">
<meta name="distribution" content="global">
<meta name="document-classification" content="general">
<meta name="rating" content="general">
<meta name="language" content="EN">
<script type="text/javascript">
function doClock(){ // 
  var t=new Date(),a=doClock.arguments,str="",i,a1,lang="1";
  var month=new Array('January','Jan', 'February','Feb', 'March','Mar', 'April','Apr', 'May','May', 'June','Jun', 'July','Jul', 'August','Aug', 'September','Sep', 'October','Oct', 'November','Nov', 'December','Dec');
  var tday= new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
  for(i=0;i<a.length;i++) {a1=a[i].charAt(1);switch (a[i].charAt(0)) {
  case "D": if ((Number(a1)==1) && (t.getDate()<10)) str+="0";str+=t.getDate();break;
  case "M":if  ((Number(a1)==3) && ((t.getMonth()+1)<10)) str+="0";
  str+=(Number(a1)>1)?t.getMonth()+1:month[t.getMonth()*2+Number(a1)];break;
  case "Y": str+=(a1=='0')?t.getFullYear():t.getFullYear().toString().substring(2);break;
  case "W":str+=tday[t.getDay()*2+Number(a1)];break; default: str+=unescape(a[i]);}}return str;
}
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td rowspan="2" width="194" valign="top"><img alt="" src="images/logo.jpg" width="250" height="165"></td>
</tr>
</table>
</body>
</html>

Open in new window

0
 

Author Comment

by:bill2013
ID: 40530043
Thanks Dave, I didn't realise there was a code box, even though it is staring at me,

I will look at the changes now and get right back.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40530051
I forgot to mention that the DOCTYPE you had in the first line was not complete.  In the code I posted, it is the first two lines.
0
 
LVL 13

Expert Comment

by:myderrick
ID: 40530059
Hi,

You have not closed a lot of the tags.

Example:
1. <meta> - You have not closed the meta tags. You should close them like so
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
All of them.

2. You Type tag doesn't have a starting  "<".
<type="text/javascript" for <script>

3. I don't see a body tag open <body> but you have a close.

Attached is what I corrected.

Code from line 1 to 34
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<meta name="keywords" content="network support, installation, network, networks, networking, specialists, Warwickshire, Staffordshire, Birmingham, installation and support, IT networking" />
<meta name="copyright" content="2004 xxxxxxxxxxxxxxxxxxxx.  All rights reserved.  Duplication of any content on this site is prohibited." />
<meta name="designers" content="xxxxxxxxxxxx.com" />
<meta name="robots" content="all" />
<meta name="revisit-after" content="7 days" />
<meta name="distribution" content="global" />
<meta name="document-classification" content="general" />
<meta name="rating" content="general" />
<meta name="language" content="EN" />
<type="text/javascript" for <script>
function doClock(){ // 
  var t=new Date(),a=doClock.arguments,str="",i,a1,lang="1";
  var month=new Array('January','Jan', 'February','Feb', 'March','Mar', 'April','Apr', 'May','May', 'June','Jun', 'July','Jul', 'August','Aug', 'September','Sep', 'October','Oct', 'November','Nov', 'December','Dec');
  var tday= new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
  for(i=0;i<a.length;i++) {a1=a[i].charAt(1);switch (a[i].charAt(0)) {
  case "D": if ((Number(a1)==1) && (t.getDate()<10)) str+="0";str+=t.getDate();break;
  case "M":if  ((Number(a1)==3) && ((t.getMonth()+1)<10)) str+="0";
  str+=(Number(a1)>1)?t.getMonth()+1:month[t.getMonth()*2+Number(a1)];break;
  case "Y": str+=(a1=='0')?t.getFullYear():t.getFullYear().toString().substring(2);break;
  case "W":str+=tday[t.getDay()*2+Number(a1)];break; default: str+=unescape(a[i]);}}return str;
}
</script>

</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td rowspan="2" width="194" valign="top"><img src="images/logo.jpg" width="250" height="165"></td>

</body>

Open in new window


Good luck.

MD
0
 

Author Comment

by:bill2013
ID: 40530064
Just seen your DOCTYPE comment and will deal with that now.

OK now up to line 50. Content below starts at line 31.

I can't understand this error:

Line 50, Column 13: end tag for "TABLE" omitted, but its declaration does not permit this

      </body>



    You forgot to close a tag, or
    you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.

The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
Info Line 32, Column 1: start tag was here

<table width="100%" border="0" cellspacing="0" cellpadding="0">

I can see where table is closed immediately above body - what am I missing?


<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td rowspan="2" width="194" valign="top"><img alt=""
    src="images/logo.jpg" width="250" height="165"></td>
    <td width="808"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="3">
        <tr> 
          <td height="35" valign="bottom" class="btnav"> 
            <div align="right"><a href="index.htm">Homepage</a> 
			| <a href="backshortly.htm">Disaster Recovery</a>
			| <a href="backshortly.htm">Clean and Clone</a>        
			| <a href="networking.htm">Networking</a> 
			| <a href="networksupport.htm">Network  Support</a> 
			| <a href="security.htm">Security</a> 
            </div>
          </td>
        </tr>
      </table>
      </body>
    </td>
  </tr>

Open in new window

0
 

Author Comment

by:bill2013
ID: 40530068
Thanks MD - I am going to be on this for ages, so please don't think I am ignoring any comments, just getting my head around it.
0
 

Author Comment

by:bill2013
ID: 40530085
Derrick, I tried the tags you suggested but they came up as errors and so I had to go back to original settings.

Dave, validator instructed me to change second line to "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd"> and that works fine.

Working through the errors.
0
 
LVL 13

Expert Comment

by:myderrick
ID: 40530101
The issue is with tags and the closing.
For <TABLE> you have <tr> and <td> after the table closes
  </table>
      </body>
    </td>
  </tr>


You have two <tables> but only one is closed. The body should normally be the last element for the hmtl body. In effect, the </body> should come after </table>

MD
0
 

Author Comment

by:bill2013
ID: 40530232
Thanks Derrick, I understand now.

I have got it down to 3 errors all "elements "o:p" undefined" and i need a bit of help here as it seems to come down to what is acceptable to the DOCTYPE,

Validation Output: 3 Errors

    Error Line 209, Column 93: element "O:P" undefined

    …or the best deals on software support click here </B></A><o:p></o:p></SPAN></P>

    ✉

    You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
        incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
        by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
        by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
    Error Line 214, Column 56: element "O:P" undefined

    style="COLOR: #0099ff; FONT-FAMILY: 'Arial'">&nbsp;<o:p></o:p></SPAN><SPAN

    ✉

    You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
        incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
        by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
        by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
    Error Line 221, Column 87: element "O:P" undefined

    …">s@abccomputersolutions.co.uk</A><o:p></o:p></SPAN><font face="Arial">&nbsp;<…

    ✉

    You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
        incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
        by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
        by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).

My line 1 is line 201:

              <P><font face="Arial"><A href="networkservers.htm"><B>For the best deals on network servers click here </B></A>
				</font></P>
              <P><font face="Arial"><A href="desktoppcs.htm"><B>For the best deals on desktop PCs click here </B></A>
				</font></P>
              <P><font face="Arial"><A href="hardwaresupport.htm"><B>For the best deals on hardware support click here</B></A></font></P>
              <P>
				<SPAN 
style="COLOR: black; FONT-FAMILY: 'Arial'; FONT-SIZE: 9pt"><A 
href="softwaresupport.htm"><B>For the best deals on software support click here </B></A><o:p></o:p></SPAN></P>
              <P><font face="Arial"><B><a href="networksupport.htm">For the best deals on network support click here</a></B></font></P>
              <P><font face="Arial"><A href="remoteaccess.htm"><B>For the best deals on remote
                    access click here</B></A></font></P>
              <H2 align=center style="TEXT-ALIGN: center"><SPAN 
style="COLOR: #0099ff; FONT-FAMILY: 'Arial'">&nbsp;<o:p></o:p></SPAN><SPAN 
style="COLOR: #0099ff; FONT-FAMILY: 'Arial'">Ring ABC Networks now on 0392
				06000 or email </SPAN>
				<a href="mailto:networks@xyzcomputersolutions.co.uk">
				<SPAN 
style="FONT-FAMILY: 'Arial'">contactu</SPAN></a><SPAN 
style="COLOR: #0099ff; FONT-FAMILY: 'Arial'"><A 
href="mailto:networks@xyzcomputersolutions.co.uk">s@xyzcomputersolutions.co.uk</A><o:p></o:p></SPAN><font face="Arial">&nbsp;</font></H2>
              <H2 align=center style="TEXT-ALIGN: center"><SPAN 
style="FONT-FAMILY: Arial">XYZ Computer Solutions for better Network Support,
                  Installation and Upgrading solutions in xxxxxxxxxxx
                  and the surrounding
                  area.</SPAN></H2>
              <p>&nbsp;</p>
          </div>
          </td>
        </tr>

Open in new window

0
 
LVL 13

Expert Comment

by:myderrick
ID: 40530253
Great. We are making progress. What element is o:p anyway? Once that is sorted, you should be fine.
0
 

Author Comment

by:bill2013
ID: 40530261
First reference to it is on line 209 (my line 9 above),
0
 

Author Comment

by:bill2013
ID: 40530290
This document was successfully checked as HTML 4.01 Transitional!
Result:       Passed

All sorted now, no errors or warnings.

If I use this page as the template for my other nine webpages what do I need to change on each page?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 13

Expert Comment

by:myderrick
ID: 40530294
The links and URLs mainly as well as obviously the contents.

MD
0
 

Author Comment

by:bill2013
ID: 40530341
Do keywords need to be unique to each page?
0
 
LVL 13

Expert Comment

by:myderrick
ID: 40530344
Keywords can be different for each site mainly because each site has a different concept.

Keywords can also be different for each page if you want to have them as such. Where each page will relate to something different.

Current Google search claims not to use keywords for searches but it's still relevant in some circles.

MD
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40530370
Current Google search claims not to use keywords for searches but it's still relevant in some circles.

The keyword meta tag is completely useless and all major/relevant search engines ignore it.  I would just remove it and the headache of keeping it/creating it.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40530498
<o:p></o:p> is a proprietary Microsoft tag that usually comes from Microsoft Word.  It is usually a do-nothing that you can remove.
0
 
LVL 13

Expert Comment

by:myderrick
ID: 40530517
Jason may be right but I still believe Google is just claiming it does not use it.

The reason why I recommend keeping it is because of other search engines other than Google.

It doesn't hurt to keep it.

MD
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40530538
Also... "mailto:" only works if the client has a 'default email client' program on their computer.  Webmail clients like Yahoo, Gmail, and Hotmail usually do not work with "mailto:".
0
 

Author Comment

by:bill2013
ID: 40531046
Am I better off removing all the "mailto:" references?
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 40531069
Most developers I know of create forms and server side pages that do email using PHP or ASP.  You might want to tackle that after you have the validation errors sorted out.  It's a different kind of project.
0
 

Author Comment

by:bill2013
ID: 40531086
I've got the first web cleared down to 0 errors/warnings, mainly from your first post.

Will take a while to sort the other pages using this as a template.
0
 

Author Closing Comment

by:bill2013
ID: 40531087
great help once again
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40531101
You're welcome, glad to help.
0
 
LVL 13

Expert Comment

by:myderrick
ID: 40531173
Glad you sorted it out.

MD
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now