SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What am I doing wrong (validate)?:(

    Hello I am from Thailand a new member and new to all tihs this.

    Today everyone seams to know how a make a web page, I made decision to try to learn Xhtml, just for fun. The simplest page possible, only some pictures and text and two links, but when i validate it is full of errors. I have sat many hour trying to solve them but without result because I don´t know what the errors means. Apparently I am to stupid to do things like stuff like this. Can anyone here help me? I would be so grateful.


    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>testpage</title>
    <meta name="testpage" content="testpage" />
    </head>

    <body>

    <table border="0" style="width: 100%">
    <caption></caption>
    <col />
    <col />
    <col />
    <tbody>
    <tr>
    <td colspan="3"><img src="pic5.jpg" alt="Pic5.jpg"width="100%"/> </td>
    </tr>
    <tr>
    <td><img src="pic6.jpg" alt="Pic6.jpg"width="320%"/> </td>
    <td><img src="pic7.jpg" alt="Pic7.jpg"width="160%"/> </td>
    <td><img src="pic8.jpg" alt="Pic8.jpg"width="320%"/> </td>
    </tr>
    <tr>
    <td><img src="pic9.jpg" alt="Pic9.jpg"width="320%"/></td>
    <td><img src="pic10.jpg" alt="Pic10.jpg"width="160%"/></td>
    <td><ul>
    <li style="font-size: 10pt"><span
    style="font-family: Arial,Helvetica,sans-serif">LึA: 15.75
    m</span></li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">LVA:
    14.50 m</li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Flower</li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Dog</li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Man with hat</li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Children</li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Fish</li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Car</li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Hourse</li>
    <li
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Cat</li>
    <li><span style="font-size: 10pt"><span style="font-size: 11pt"><span
    style="font-family: Arial,Helvetica,sans-serif"><span
    style="font-family: Times New Roman,Times,serif"><span
    style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt">Happy:
    sad</span></span></span></span></span></li>
    </ul>
    </td>
    </tr>
    <tr>
    <td></td>
    <td></td>
    <td style="text-align:center;"><a href="testpage2.html">Back</a></td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would have been easier if you (a) had told us what validation error you got and (b) had put the markup inside &#91;code&#93;...&#91;/code&#93; tags.

    One thing I did notice in your code is that you run attributes together in some places, e.g.,
    Code:
    <img src="pic5.jpg" alt="Pic5.jpg"width="100&#37;"/>
    There must be at least one white-space character between attributes in HTML and XHTML. Insert a space between "Pic5.jpg" and width=.
    Code:
    <img src="pic5.jpg" alt="Pic5.jpg" width="100%"/>
    You've got that in several other pictures, too.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you I am so grateful. Now my confidence is better. Everything it is ok now thank you much. Now Iwill try to solve the other 2 pages to. But I will try by myself so I learn something.
    Last edited by Ijustwanttolearn; Jul 2, 2008 at 01:20.

  4. #4
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I meet problems again. How can 10 year old girls have own webpage? I feel so stupid. I made errors in color so it more easy tosee.

    <body>

    <img src="pic1.jpg" alt="Pic1.jpg" width="850" height="562"/>


    <table border="0" style= width= 100&#37;/>
    <caption></caption>
    <col />
    <col />
    <tbody>
    <tr>
    <td colspan="150"
    <img src="pic2.jpg" alt="Pic2.jpg" width="400" height="269" />


    <img src="pic3.jpg" alt="Pic3.jpg" width="400" height="281" />

    <div>
    </div>
    </td>
    <td style="text-align:center;"><span style="font-size: 11pt"><span
    style="font-family: Arial,Helvetica,sans-serif"><span
    style="font-size: 10pt"><strong><span style="font-size: 11pt">Headline</span></strong></span></span></span>

    <p style="font-family: Arial,Helvetica,sans-serif;font-size: 10pt"></p>

    <p
    style="text-align:justify;font-family: Arial,Helvetica,sans-serif;font-size: 10pt"><span
    style="font-size: 10pt"><span style="font-size: 11pt"><span
    style="font-size: 10pt">text</span></span></span></p>

    <p
    style="text-align:justify;font-family: Arial,Helvetica,sans-serif;font-size: 10pt"><em>&rdquo;text;</em></p>

    <p
    style="text-align:left;font-family: Arial,Helvetica,sans-serif;font-size: 10pt"><a
    name="Click" id="Click" href="Sid2.html">Read more</a><span style="text-align:justify;"></span></p>

    <p style="text-align:left;"><span style="font-size: 10pt"><span
    style="font-size: 11pt"><span
    style="font-family: Arial,Helvetica,sans-serif"><span
    style="font-size: 10pt"><span style="text-align:justify;"><a
    href="Sid3.html">Click next page</a></span></span></span></span></span></p>

    <img src="pic4.jpg" alt="Pic4.jpg" width="400" height="113"/>

    </td>
    </tr >
    </tbody >
    </table >

    </body >
    </html >
    _________________

    Error messages:10

    Line 16, Column 25: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <table border="0" style= width= 100%/>

    ------
    Line 16, Column 30: an attribute specification must start with a name or name token.

    <table border="0" style= width= 100%/>

    An attribute name (and some attribute values) must start with one of a restricted set of characters. This error usually indicates that you have failed to add a closing quotation mark on a previous attribute value (so the attribute value looks like the start of a new attribute) or have used an attribute that is not defined (usually a typo in a common attribute name).
    -----

    Line 16, Column 32: character data is not allowed here.

    <table border="0" style= width= 100%/>

    You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include:

    * putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
    * forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes), or
    * using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character

    ------
    Line 23, Column 0: unclosed start-tag requires SHORTTAG YES.

    <img src="pic2.jpg" alt="Pic2.jpg" width="400" height="269" />

    The construct <foo<bar> is valid in HTML (it is an example of the rather obscure “Shorttags” feature) but its use is not recommended. In most cases, this is a typo that you will want to fix. If you really want to use shorttags, be aware that they are not well implemented by browsers

    ------
    Line 16, Column 25: XML Parsing Error: AttValue: " or ' expected.

    <table border="0" style= width= 100%/>

    -----------
    Line 16, Column 25: XML Parsing Error: Couldn't find end of Start Tag table line 16.

    <table border="0" style= width= 100%/>

    -------
    Line 23, Column 11: XML Parsing Error: error parsing attribute name.

    <img src="pic2.jpg" alt="Pic2.jpg" width="400" height="269" />

    -------

    [COLOR="Purple]Line 58, Column 10: XML Parsing Error: Opening and ending tag mismatch: tbody line 20 and tr.

    </tr >

    -----------
    Line 59, Column 11: XML Parsing Error: Opening and ending tag mismatch: body line 11 and tbody.

    </tbody >
    -------

    Line 60, Column 9: XML Parsing Error: Opening and ending tag mismatch: html line 4 and table.

    </table >[/COLOR]

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,784
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    <table border="0" style= width= 100&#37;/>

    should be

    <table border="0" style="" width="100%" />


    Don't leave spaces between the attribute name and the = and the value following. It is also better to put all the values inside " so you can see where they start and finish (it is optional in HTML unless the value contains spaces but mandatory in XHTML). Also to be able to serve the XHTML as HTML (so that IE can process it) you need a space before the closing /
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    <table border="0" style= width= 100%/>

    should be

    <table border="0" style="" width="100%" />


    Don't leave spaces between the attribute name and the = and the value following. It is also better to put all the values inside " so you can see where they start and finish (it is optional in HTML unless the value contains spaces but mandatory in XHTML). Also to be able to serve the XHTML as HTML (so that IE can process it) you need a space before the closing /
    Thank for you reply. I have tried you suggestion and got this:

    "Line 16, Column 41: end tag for "table" which is not finished.

    <table border="0" style="" width="100%" />

    Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

    Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.


  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    <table border="0" style= width= 100%/>

    should be

    <table border="0" style="" width="100%" />
    It should be
    Code:
    <table style="border:0; width:100%">

    Quote Originally Posted by felgall View Post
    Don't leave spaces between the attribute name and the = and the value following. It is also better to put all the values inside " so you can see where they start and finish (it is optional in HTML unless the value contains spaces but mandatory in XHTML).
    There are many other characters than spaces that makes the quotes required in HTML. Since it's hard to remember exactly which ones, it's best always to use quotes even in HTML.

    Quote Originally Posted by Ijustwanttolearn View Post
    Line 16, Column 41: end tag for "table" which is not finished.

    <table border="0" style="" width="100%" /
    You have an extra '/' before the '>'.
    In XHTML, <table/> is the same as <table></table>, which is invalid (a table must contain at least one row).

    You only use the '/>' syntax for empty elements. Since you're not really using XHTML at all, you can only use the '/>' syntax for elements that are always empty, like <img/> and <br/>.
    Birnam wood is come to Dunsinane

  8. #8
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AutisticCuckoo

    What you mean "Since you're not really using XHTML at all"? My i tried, same result:

    Line 23, Column 0: unclosed start-tag requires SHORTTAG YES.

    <img src="pic2.jpg" alt="Pic2.jpg" width="400" height="269" />


    The construct <foo<bar> is valid in HTML (it is an example of the rather obscure “Shorttags” feature) but its use is not recommended. In most cases, this is a typo that you will want to fix. If you really want to use shorttags, be aware that they are not well implemented by browsers.


    and:

    Line 24, Column 0: unclosed start-tag requires SHORTTAG YES.

    <img src="pic2.jpg" alt="Pic2.jpg" width="400" height="269" >



    The construct <foo<bar> is valid in HTML (it is an example of the rather obscure “Shorttags” feature) but its use is not recommended. In most cases, this is a typo that you will want to fix. If you really want to use shorttags, be aware that they are not well implemented by browsers.



    Thanks for all your replies.

  9. #9
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ijustwanttolearn View Post
    What you mean "Since you're not really using XHTML at all"?
    Unless you are serving your document as an application of XML, you are not using XHTML. You are using badly written HTML as far as browsers are concerned, and relying on their parser bugs and error handling to make it work. Don't worry, 99.999% of all web designers/developers don't know this.

    If you were serving this document as real XHTML you wouldn't see anything but a big fat error messages about failed XML parsing.

    See the XHTML vs HTML FAQ for a lot more details.

    Quote Originally Posted by Ijustwanttolearn View Post
    Line 23, Column 0: unclosed start-tag requires SHORTTAG YES.
    That's because you've left out the '>' on the preceding tag.
    Code:
    <td colspan="150"
    should be
    Code:
    <td colspan="150">
    Although it looks very suspicious to begin with. Do you really have one hundred and fifty columns in that table?!
    Birnam wood is come to Dunsinane


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
  •