Guilhermexpt1 1 Denunciar post Postado Maio 22, 2013 Pessoal, estou com um problema na validação de uma loja virtual em Opencart 1.5.4 no w3c. Foram acusados 30 e vários deles estão relacionados ao menu do site. Tenho certeza que o a solução é simples, mas é a minha ignorância está maior que a solução. O erro que está sendo acusado pelo w3c é o seguinte: Line 97, Column 12: document type does not allow element "li" here; missing one of "ul", "ol" start-tag <li><a href="URL DO SITE/topico">Topico<… 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>"). E o código do menu que tem essa série de erros é esse: <?php if ($categories) { ?> <div id="menu-holder" class="hidden-phone"> <div id="menu"> <ul> <li><a href="<?php echo $home; ?>"><span class='home_icon'></span></a> <?php foreach ($categories as $category) { ?> <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a> <?php if ($category['children']) { ?> <div> <?php for ($i = 0; $i < count($category['children']);) { ?> <ul> <?php $j = $i + ceil(count($category['children']) / $category['column']); ?> <?php for (; $i < $j; $i++) { ?> <?php if (isset($category['children'][$i])) { ?> <li><a<?php echo ($i==(count($category['children'])-1) ? " class='last_submenu_item'" : '');?> href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li> <?php } ?> <?php } ?> </ul> <?php } ?> </div> <?php } ?> </li> <?php } ?> </ul> </div> </div> <?php } ?> Vocês podem me ajudar? Desde já agradeço Compartilhar este post Link para o post Compartilhar em outros sites
William Bruno 1501 Denunciar post Postado Maio 22, 2013 retire essas divs ai do meio, e vc não fechou o LI de cima: <li><a href="<?php echo $home; ?>"><span class='home_icon'></span></a> Compartilhar este post Link para o post Compartilhar em outros sites
EduardoAugustoPHP 27 Denunciar post Postado Maio 23, 2013 Sempre que abrir uma taga, feche-a imediatamente. Isso ajuda muito nesses casos. Porque div dentro de <li> ? Compartilhar este post Link para o post Compartilhar em outros sites
Guilhermexpt1 1 Denunciar post Postado Junho 3, 2013 É porque existe uma função do tema que dá ao usuário a opção de escolher a quantidade de colunas que os subitens do menu ficarão dispostos. Deu tudo certo aqui. Valeu!! Compartilhar este post Link para o post Compartilhar em outros sites