Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [xHTML][w3c] Wadliacja kodu xHTML
Forum PHP.pl > Forum > Przedszkole
qba10
Mam o to taki dokument:
  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta http-equiv="Content-Language" content="pl" />
  8. <title>Jump PHP - System zarządzania stroną</title>
  9. <meta name="Robots" content="all" />
  10. <meta name="Author" content= "Piotr Piórkowski" />
  11. <script type="text/javascript">
  12. <!--
  13. if(-1 != navigator.userAgent.indexOf("MSIE"))
  14. {
  15. // Internet Explorer
  16. document.write('<link rel="stylesheet" href= "style/style-ie.css" type="text/css" />');
  17. }
  18. else (-1 != navigator.userAgent.indexOf("Mozilla"))
  19. {
  20. // Netscape
  21. document.write('<link rel="stylesheet" href= "style/style-ns.css" type="text/css" />');
  22. }
  23.  
  24. //-->
  25. </script>
  26.  
  27. </head>
  28. <body>
  29. <div id="top">
  30.  
  31. <div id="podloze">
  32. <div id="in_podloze">
  33.  
  34. <div id="baner">
  35. <img src="grafika/baner.png" alt="Jump PHP" />
  36. </div>
  37. <div id="kolo_baneru">
  38. <span style="color:#16ba14;
  39. font-weight: bold;
  40. font-size: 12pt;
  41. font-family: comic sans ms ;">
  42. Witaj gość</span>
  43. <br /><br />
  44. <span style="
  45. font-weight: bold;
  46. font-size: 10pt;
  47. font-family: comic sans ms ;">
  48. <span style="color:#ff66d5;">Logowanie:</span> <br /><form action="" method="post"> <table><tr><td><span style="color:#348ee3;">Login:</span></td><td> <input type="text" name="login" style="width: 100px" /></td></tr><tr><td><span style="color:#348ee3;">Hasło:</span></td><td><input type="password" name="haslo" style="width: 100px" /></td></tr></table><input type="submit" name="logowanie" value="Zaloguj" style="color: #348EEA; background-color: #FFBA00; font-family: comic sans ms ; font-weight: bold; border-style: none;" /></form>
  49. </span>
  50. </div>
  51. <div id="menu">
  52.  
  53.  
  54. <a href="http://www.pckurier.pl" onMouseOver='rollover1.src="grafika/buton_o_projekcie_in.png"'
  55. onMouseOut='rollover1.src="grafika/buton_o_projekcie_out.png"' >
  56. <img src="grafika/buton_o_projekcie_out.png" name="rollover1" alt="" /></a>
  57.  
  58. <a href="http://www.pckurier.pl" onMouseOver='rollover2.src="grafika/buton_o_projekcie_in.png"'
  59. onMouseOut='rollover2.src="grafika/buton_o_projekcie_out.png"' >
  60. <img src="grafika/buton_o_projekcie_out.png" name="rollover2" alt="" /></a>
  61.  
  62. <a href="http://www.pckurier.pl" onMouseOver='rollover3.src="grafika/buton_historia_projektu_in.png"'
  63. onMouseOut='rollover3.src="grafika/buton_historia_projektu_out.png"' >
  64. <img src="grafika/buton_historia_projektu_out.png" name="rollover3" alt="" /></a>
  65.  
  66. <a href="http://www.pckurier.pl" onMouseOver='rollover4.src="grafika/buton_download_in.png"'
  67. onMouseOut='rollover4.src="grafika/buton_download_out.png"' >
  68. <img src="grafika/buton_download_out.png" name="rollover4" alt="" /></a>
  69.  
  70. <a href="http://www.pckurier.pl" onMouseOver='rollover5.src="grafika/buton_pomoc_in.png"'
  71. onMouseOut='rollover5.src="grafika/buton_pomoc_out.png"' >
  72. <img src="grafika/buton_pomoc_out.png" name="rollover5" alt="" /></a>
  73.  
  74. <a href="http://www.pckurier.pl" onMouseOver='rollover6.src="grafika/buton_jump_team_in.png"'
  75. onMouseOut='rollover6.src="grafika/buton_jump_team_out.png"' >
  76. <img src="grafika/buton_jump_team_out.png" name="rollover6" alt="" /></a>
  77. </div>
  78.  
  79. <div id="text">
  80.  
  81.  
  82.  
  83. <div id="stopka">
  84. <div id="stopka-text">
  85. Copyright &copy; by Jump Team 2007-2008
  86. </div>
  87. </div>
  88.  
  89. </div>
  90. </div>
  91. </div>
  92.  
  93. </div>
  94.  
  95.  
  96.  
  97. </body>
  98. </html>

Mam prośbę by ktoś sprawdził ten kod czy jest zgodny ze standardami i wyjaśnił jak poprawić 5 błędów, które tam wysakują.
.radex
prosiłbym o podanie na forum tych błędów. Nie chcę mi (i myślę, że nie tylko mi) się sprawdzać samemu tongue.gif
qba10
  1. Line 48, Column 82: document type does not allow element "form" here; missing one of "object", "ins", "del", "map" start-tag.…> <br /><form action="" method="post"> <table><tr><td><span style="color:#348

    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
  2. Line 48, Column 528: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.…-weight: bold; border-style: none;" /></form>

    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
  3. Line 54, Column 45: there is no attribute "onMouseOver".…"http://www.pckurier.pl" onMouseOver='rollover.src="grafika/buton_strona_glow

    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. 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 "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
  4. Line 55, Column 11: there is no attribute "onMouseOut".onMouseOut='rollover.src="grafika/buton_strona_glowna_out.png"' >

    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. 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 "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
  5. Line 56, Column 54: there is no attribute "name".<img src="grafika/buton_strona_glowna_out.png" name="rollover" alt="" /></a>

    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. 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 "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.



To teraz takie pytanie.... Czy ktoś rozumie questionmark.gifquestionmark.gif?
Shili
1. w elemencie span nie możesz umieścić elementu form.

2. element input MUSI być w innym elemencie. W jakim - masz to wyraźnie napisane.

3. atrybuty piszemy małymi literami. Nie onMouseOver, ale onmouseover. tak samo z punktem 4.

5. tag img nie może zawierać atrybutu name.
qba10
Proszę pomóżcie mi przy ad.2 bo problem po zmianach nadal występuję, a błędu w kodzie nie widzę.
Kod po zmianach:
  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta http-equiv="Content-Language" content="pl" />
  8. <title>Jump PHP - System zarządzania stroną</title>
  9. <meta name="Robots" content="all" />
  10. <meta name="Author" content= "Piotr Piórkowski" />
  11. <script type="text/javascript">
  12. <!--
  13. if(-1 != navigator.userAgent.indexOf("MSIE"))
  14. {
  15. // Internet Explorer
  16. document.write('<link rel="stylesheet" href= "style/style-ie.css" type="text/css" />');
  17. }
  18. else (-1 != navigator.userAgent.indexOf("Mozilla"))
  19. {
  20. // Netscape
  21. document.write('<link rel="stylesheet" href= "style/style-ns.css" type="text/css" />');
  22. }
  23.  
  24. //-->
  25. </script>
  26.  
  27. </head>
  28. <body>
  29. <div id="top">
  30.  
  31. <div id="podloze">
  32. <div id="in_podloze">
  33.  
  34. <div id="baner">
  35. <img src="grafika/baner.png" alt="Jump PHP" />
  36. </div>
  37. <div id="kolo_baneru">
  38. <span style="color:#16ba14;
  39. font-weight: bold;
  40. font-size: 12pt;
  41. font-family: comic sans ms ;">
  42. Witaj gość</span>
  43. <br /><br />
  44.  
  45. <span style="color:#ff66d5;font-weight: bold;
  46. font-size: 10pt;
  47. font-family: comic sans ms ;">Logowanie:</span> <br /><form action="" method="post"> <table><tr><td><span style="color:#348ee3;font-weight: bold;
  48. font-size: 10pt;
  49. font-family: comic sans ms ;">Login:</span></td><td> <input type="text" name="login" style="width: 100px" /></td></tr><tr><td><span style="color:#348ee3;font-weight: bold;
  50. font-size: 10pt;
  51. font-family: comic sans ms ;">Hasło:</span></td><td><input type="password" name="haslo" style="width: 100px" /></td></tr></table>
  52.  
  53. <input type="submit" name="logowanie" value="Zaloguj" style="color: #348EEA; background-color: #FFBA00; font-family: comic sans ms ; font-weight: bold; border-style: none;" />
  54.  
  55. </form>
  56.  
  57. </div>
  58. <div id="menu">
  59.  
  60.  
  61. <a href="http://www.pckurier.pl" onmouseover='rollover1.src="grafika/buton_o_projekcie_in.png"'
  62. onmouseout='rollover1.src="grafika/buton_o_projekcie_out.png"' >
  63. <img src="grafika/buton_o_projekcie_out.png" id="rollover1" alt="" /></a>
  64.  
  65. <a href="http://www.pckurier.pl" onmouseover='rollover2.src="grafika/buton_o_projekcie_in.png"'
  66. onmouseout='rollover2.src="grafika/buton_o_projekcie_out.png"' >
  67. <img src="grafika/buton_o_projekcie_out.png" id="rollover2" alt="" /></a>
  68.  
  69. <a href="http://www.pckurier.pl" onmouseover='rollover3.src="grafika/buton_historia_projektu_in.png"'
  70. onmouseout='rollover3.src="grafika/buton_historia_projektu_out.png"' >
  71. <img src="grafika/buton_historia_projektu_out.png" id="rollover3" alt="" /></a>
  72.  
  73. <a href="http://www.pckurier.pl" onmouseover='rollover4.src="grafika/buton_download_in.png"'
  74. onmouseout='rollover4.src="grafika/buton_download_out.png"' >
  75. <img src="grafika/buton_download_out.png" id="rollover4" alt="" /></a>
  76.  
  77. <a href="http://www.pckurier.pl" onmouseover='rollover5.src="grafika/buton_pomoc_in.png"'
  78. onmouseout='rollover5.src="grafika/buton_pomoc_out.png"' >
  79. <img src="grafika/buton_pomoc_out.png" id="rollover5" alt="" /></a>
  80.  
  81. <a href="http://www.pckurier.pl" onmouseover='rollover6.src="grafika/buton_jump_team_in.png"'
  82. onmouseout='rollover6.src="grafika/buton_jump_team_out.png"' >
  83. <img src="grafika/buton_jump_team_out.png" id="rollover6" alt="" /></a>
  84. </div>
  85.  
  86. <div id="text">
  87.  
  88.  
  89.  
  90. <div id="stopka">
  91. <div id="stopka-text">
  92. Copyright &copy; by Jump Team 2007-2008
  93. </div>
  94. </div>
  95.  
  96. </div>
  97. </div>
  98. </div>
  99.  
  100. </div>
  101.  
  102.  
  103.  
  104. </body>
  105. </html>
Shili
Obejmij inputy jednym z elementów wyróżnionych w punkcie 2. Proponuję diva.
qba10
Pomogło.... Z drugiej strony oni już przesadzają z tymi standardami, ale cóż trzeba się pochwalić że stronka jest wogóle zrobiona wg jakichkolwiek standardów.

Dzięki i Pozdrawiam smile.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.