SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Non-Member
    Join Date
    Jun 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Valid XHTML document

    Hi, i am trying to make my HTML document valid using the W3 HTML validator and i keep getting errors. Please can you guys provide some advice:

    1. Error Line 5 column 5: element "Head" undefined.
    <Head>

    2.Error Line 6 column 6: element "Title" undefined.
    <Title>home</Title>

    3.Error Line 12 column 17: there is no attribute "HTTP-EQUIV".
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

    4.Error Line 12 column 40: there is no attribute "CONTENT".
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

    5.Error Line 12 column 71: element "META" undefined.
    ...-Type" CONTENT="text/html; charset=iso-8859-1">

    6.Error Line 13 column 6: end tag for "META" omitted, but OMITTAG NO was specified.
    </Head>

    7.Error Line 14 column 17: there is no attribute "Background".
    <BODY Background="back.jpg" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT.

    8.Error Line 14 column 39: there is no attribute "LEFTMARGIN".
    <BODY Background="back.jpg" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT.

    9.Error Line 14 column 39: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified

    10.Error Line 51 column 41: end tag for "br" omitted, but OMITTAG NO was specified

    thanks

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What DOCTYPE are you using? Any chance of seeing the code in its entirety?
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    SitePoint Evangelist Maujor's Avatar
    Join Date
    Mar 2005
    Location
    Rio de Janeiro - Brazil - South America
    Posts
    408
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Give the link for the document.
    It's impossible to point out a solution without seeing the code.
    Mauricio Samy Silva
    http://www.maujor.com/

  4. #4
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All errors have to do with case sensitivity and well-formedness, and obviously there's an XHTML 1.0 Transitional doctype.

    Change all element names and attribute names to lower case. Quote all attribute values. Use XML empty-element syntax for elements that are declared as EMPTY, such as meta and br.
    HTML Code:
    ...
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>home</title>
    </head>
    <body>
    ...
    <br />
    ...
    ...or you could change the doctype to:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    HTH
    Simon Pieters

  5. #5
    Non-Member
    Join Date
    Jun 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry guys. here is the code in full it is an empty template and has a page counter thanks:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <Head>
    <Title>home</Title>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    </Head>
    <BODY Background="back.jpg" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>


    <TABLE WIDTH=831 height="893" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
    <TR>

    <TD height="90"> <IMG SRC="images/nsabasi3_01.gif" WIDTH=831 HEIGHT=90 ALT="logo"></TD>
    </TR>
    <TR>
    <TD background="images/nsabasi3_02.gif" height="613">
    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="76%" id="AutoNumber1" height="35">
    <tr>
    <td width="100%" height="19">
    <p style="line-height: 200%"> </font></p>
    <p style="line-height: 200%">
    <font face="Arial" size="2" color="#FFFFFF"></font></p>

    <p style="line-height: 200%" align="left"> <font face="Arial" size="2" color="#FFFFFF"></font><font size="2" face="Arial" color="#FFFFFF"><br>
    </font><br>
    </p>
    </td>
    </tr>
    </table>
    </center>
    </div>
    </TD>
    </TR>
    <TR>

    <TD height="142"> <img src="images/nsabasi3_03.gif" alt="menu" width="831" height="142" border="0" usemap="#Map"></TD>
    </TR>
    <TR>

    <TD height="48" background="images/nsabasi3_04.gif"><div align="center">&nbsp;&nbsp;<font color="#ffffff" size="1" face="Arial, Helvetica, sans-serif"><br>
    Best optimised for 10274x768 resolution.<!-- Start of StatCounter Code -->
    <script type="text/javascript">
    <!--
    var sc_project=521872;
    var sc_invisible=1;
    var sc_partition=3;
    var sc_security="";
    //-->
    </script>

    <script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript>
    <div class="statcounter"><a class="statcounter" href="http://www.statcounter.com/"><img class="statcounter" src="http://c4.statcounter.com/counter.php?sc_project=521872&amp;java=0&amp;security=&amp;invisible=1" alt="free site statistics" /></a></div></noscript>
    <!-- End of StatCounter Code --> </font></div></TD>
    </TR>
    </TABLE>

    <map name="Map">
    <area shape="rect" coords="638,10,689,35" href="index.html" alt="home">
    <area shape="rect" coords="635,44,715,63" href="portfolio.html" alt="portfolio">
    <area shape="rect" coords="635,66,703,84" href="gallery.html" alt="gallery">
    <area shape="rect" coords="638,90,696,104" href="awards.html" alt="awards" />
    <area shape="rect" coords="640,106,719,128" href="contact.html" alt="contact me">
    </map>
    </BODY>

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As zcorpan said, you must use all lowercase for element and attribute names in XHTML. HTML is case-insensitive but XHTML, being XML, is not.

    All attribute values must be quoted, and all elements must be closed - including those that don't even have a closing tag in HTML.

    So use <head> instead of <Head> etc.

    Also, the FONT element type is deprecated and does not exist in HTML 4.01 Strict or XHTML 1.0 Strict. You should use CSS instead, or regress to a Transitional doctype declaration.

    The LEFTMARGIN and TOPMARGIN are not valid in any (X)HTML DTD. The MARGINWIDTH and MARGINHEIGHT attributes are defined in the Framset DTD, but are not valid for BODY.

    Or, as zcorpan suggested, if you're not aware of this, you are probably better off using HTML.
    Last edited by AutisticCuckoo; Sep 28, 2005 at 02:52.
    Birnam wood is come to Dunsinane

  7. #7
    Non-Member
    Join Date
    Jun 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks guys. i think i will stick with HTML :0


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •