Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

eng442

[Resolvido] W3C validation

Recommended Posts

Não estou entendendo por que foram apontados erros no meu código pelo W3C validator... A explicação fornecida não faz sentido.

 

Os 16 primeiros erros (até Line 18, Column 1100) são do código inserido pelo XPG.

 

São 2 ou 3 erros apontados que se repetem várias vezes no código, se alguém puder dar uma olhada em só 1 deles já ajudaria...

 

Link para o validator:

http://www.teste442.xpg.com.br/novo/&charset=(detect+automatically'>http://validator.w3.org/check?uri=http://www.teste442.xpg.com.br/novo/&charset=(detect+automatically)&doctype=Inline&group=0

 

Link para a página:

http://www.teste442.xpg.com.br/novo/

 

HTML:

<!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="pt-br">

<head>

	<title>Drop-down menu bonito</title>

	<link rel="stylesheet" type="text/css" href="css/style.css" />

	<script type="text/javascript" src="js/jquery.js"></script> 

	<script type="text/javascript" src="js/ddm.js"></script>

	<meta http-equiv="content-language" content="pt-br" />

	<meta http-equiv="Content-Type"  content="text/html; charset=iso-8859-1" />

	<meta name="description" content="Um drop-down menu bonito usando HTML, CSS e JavaScript/JQuery" />

	<meta name="keywords" content="dropdown, drop, down, menu, list, html, css, java, jquery" />

<style> 
body{margin-top:0px !important;}
</style> 
</head>

<body id="site"> 
<script type="text/javascript">if( top.location.href==self.location.href ){document.write('<div style="display:block !important;height:30px !important;"> </div>');document.write('<div style="display:block !important;position:absolute !important;top:0px !important;left:0px !important;width:100% !important;padding:0px !important;margin:0px !important;height:30px !important;z-index:2147483647 !important;" align="center">');document.write('<iframe style="display:block !important;width:100% !important;height:30px !important;z-index:2147483647 !important;" src="http://www6.xpg.com.br/barra-gratis.php?url=www.teste442.xpg.com.br" border="0" frameborder="0" width="100%" height="30"></iframe>') ; document.write('</div>') ; document.write('<div style="position:absolute;top:30px;right:0px;display:block !important;width:160px !important;height:600px !important;z-index:2147483647 !important;">') ; document.write('<scr'+'ipt type="text/javascript" src="http://www2.xpg.com.br/sites/xbar2.php"></scr'+'ipt>');document.write('</div>') ; }else{document.write('<div style="display:none !important;"></div>') ; }</script>

	<!-- // MENUS // --> <div class="no_dec_w"> <!-- Classe usada para estilização de links" -->

	<ul class="menu">

		<li><span id="click"><a href="#" id="topo" class="topo">+ Menu</a></span></li> <!--Span se faz necessário aqui devido à complicações com o JQuery -->

		<div id="submenu" class="submenu">

		<li><a href="#">Primeiro</a></li>

		<li><a href="#">Segundo</a></li>

		<li><a href="#">Terceiro</a></li>

		</div>

	</ul>

	<ul class="menu" id="menu2">

		<li><span id="click2"><a href="#" id="topo2" class="topo">+ Menu</a></span></li>

		<div id="submenu2" class="submenu">

		<li><a href="#">Primeiro</a></li>

		<li><a href="#">Segundo</a></li>

		<li><a href="#">Terceiro</a></li>

		</div>

	</ul>

	</div>

</body>

</html>

 

Os erros apontados:

 

 Line 22, Column 37: document type does not allow element "div" here; assuming missing "li" start-tag
		<div id="submenu" class="submenu">
✉
Line 23, Column 7: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
		<li><a href="#">Primeiro</a></li>
✉
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>").

Line 24, Column 7: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
		<li><a href="#">Segundo</a></li>
✉
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>").

Line 25, Column 7: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
		<li><a href="#">Terceiro</a></li>
✉
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>").

Line 27, Column 7: end tag for "li" omitted, but OMITTAG NO was specified
	</ul>
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Line 22, Column 4: start tag was here
		<div id="submenu" class="submenu">
Line 30, Column 38: document type does not allow element "div" here; assuming missing "li" start-tag
		<div id="submenu2" class="submenu">
✉
Line 31, Column 7: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
		<li><a href="#">Primeiro</a></li>
✉
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>").

Line 32, Column 7: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
		<li><a href="#">Segundo</a></li>
✉
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>").

Line 33, Column 7: document type does not allow element "li" here; missing one of "ul", "ol" start-tag
		<li><a href="#">Terceiro</a></li>
✉
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>").

Line 35, Column 7: end tag for "li" omitted, but OMITTAG NO was specified
	</ul>
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Line 30, Column 4: start tag was here
		<div id="submenu2" class="submenu">

Compartilhar este post


Link para o post
Compartilhar em outros sites

essa div:

<li><span id="click2"><a href="#" id="topo2" class="topo">+ Menu</a></span></li>

<div id="submenu2" class="submenu">

não faz sentido ai dentro do UL

se isso vai ser um submenu, a marcação correta seria:

 

<li><span id="click2"><a href="#" id="topo2" class="topo">+ Menu</a></span>

<ul id="submenu2" class="submenu">.... 

entendeu ?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Valeu, entendi, realmente estava errado.

 

Porém, ao substituir a <div> por <ul> o W3C continua apontando erros (diferentes):

 

 

58334183.gif

 

Ficou assim:

 

	<body id="site">
	<!-- // MENUS // --> <div class="no_dec_w"> <!-- Classe usada para estilização de links" -->
	<ul class="menu">
		<li><span id="click"><a href="#" id="topo" class="topo">+ Menu</a></span></li> <!--Span se faz necessário aqui devido à complicações com o JQuery -->
		<ul id="submenu" class="submenu">
			<li><a href="#">Primeiro</a></li>
			<li><a href="#">Segundo</a></li>
			<li><a href="#">Terceiro</a></li>
		</ul>
	</ul>
	<ul class="menu" id="menu2">
		<li><span id="click2"><a href="#" id="topo2" class="topo">+ Menu</a></span></li>
		<ul id="submenu2" class="submenu">
			<li><a href="#">Primeiro</a></li>
			<li><a href="#">Segundo</a></li>
			<li><a href="#">Terceiro</a></li>
		</ul>
	</ul>
	</div>
</body>

Compartilhar este post


Link para o post
Compartilhar em outros sites

olha esse trecho:

                        <li><span id="click"><a href="#" id="topo" class="topo">+ Menu</a></span></li> <!--Span se faz necessário aqui devido à complicações com o JQuery -->
                       <ul id="submenu" class="submenu">
                               <li><a href="#">Primeiro</a></li>
                               <li><a href="#">Segundo</a></li>
                               <li><a href="#">Terceiro</a></li>
                       </ul>

o correto é:

 

                        <li><span id="click"><a href="#" id="topo" class="topo">+ Menu</a></span>
                       <ul id="submenu" class="submenu">
                               <li><a href="#">Primeiro</a></li>
                               <li><a href="#">Segundo</a></li>
                               <li><a href="#">Terceiro</a></li>
                       </ul>
                       </li>

entendeu ? com o LI fechando após o </ul>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.