Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Validator xHTML + PHP
#1
Big Grin 
Witam wszystkich uzytkowników! Big Grin

Stworzyłem swoja pierwsza strone opieracjaca sie o xhtml oraz css i napotkałem pewien problem z validatorem xhtml.
Kod zapisany został w pliku index.php w którym umieściłem funkcję
<?php include('menu.php');?> odwołująca sie do menu na mojej stronie.

Validator po sprawdzeniu pliku wywołuje jeden błąd:

Line 37, Column 44: document type does not allow element "html" here
<html xmlns="http://www.w3.org/1999/xhtml" >

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


Usunąłem już sporo niezgodnosci kodu, lecz w tym przypadku nie mam pojecia co jest nie tak ;-) Poniżej przedstawiam kod źródłowy wyświetlany przez validator (połączone index.php + menu.php)

Mam nadzieje ze wyjaśniłem się dosyć jasno by ocenić co jest przyczyną tego błędu.

Kod:
<!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" xml:lang="pl" lang="pl">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-2" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="description" content="Nazwa strony" />
<meta name="keywords" content="slowa kluczowe" />
<meta name="robots" content="index, follow" />
<title>Tytul </title>
<link href="css/style-php.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="strona">
<map name="link-top" id="mapa2">
<area href="index.html" shape="rect" coords="24, 39, 335, 132" alt="Strona Gwna" id="mapa" />
</map>
<div id="menuTop">
<ul>
MENU DODATKOWE
</ul>
</div>
<div id="logo"> <img src="obrazki/logo-top.jpg" usemap="#link-top" alt="" style="border: 0;" /></div>
<div id="boxTop"></div>
<div id="menu2">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-2" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="description" content="Nazwa strony" />
<meta name="keywords" content="slowa kluczowe" />
<meta name="robots" content="index, follow" />
<title>Tytul</title>
<link href="css/style-menu-php.css" rel="stylesheet" type="text/css" />
</head>
<body>

TRESC MENU

</p>
</div>
</body>
</html>
</div>

<div id="content">

TRESC STRONY

</div>
<div id="footer"><img src="obrazki/copyright.gif" id="pozycja-copyright" alt="" /></div>
</div>
</body>
</html>
Odpowiedz


Wiadomości w tym wątku
Validator xHTML + PHP - przez rabbit404 - 04-05-2009, 23:13
RE: Validator xHTML + PHP - przez Labsta.com - 04-05-2009, 23:34
RE: Validator xHTML + PHP - przez rabbit404 - 04-05-2009, 23:43
RE: Validator xHTML + PHP - przez Labsta.com - 05-05-2009, 00:23

Podobne wątki…
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
  Błędy CSS VAlidator kkwiatkowski 2 3,271 08-02-2014, 21:27
Ostatni post: Kartofelek
  validator naprawa błędów w4wer 5 5,254 16-01-2014, 19:44
Ostatni post: Engine
  [xHTML][CSS][JQ] Dopasowanie strony do rozdzielczości ekranu. kadobe 3 4,408 17-08-2013, 01:57
Ostatni post: msx83
  [XHTML] Div - problem szerokosc i obramowanie greg_1992 2 3,221 03-01-2012, 03:10
Ostatni post: greg_1992
  [xHTML] w DIVie Ririsu 2 2,536 08-09-2011, 15:20
Ostatni post: Ririsu

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl