在此上下文中,元素li不允许作为元素div的子元素。 (抑制此子树中的更多错误。)

时间:2014-09-09 07:56:46

标签: php css wordpress plugins widget

我目前正在开发一个网站,..当使用validator.w3验证网站时,它有这样的错误:

Element li not allowed as child of element div in this context. (Suppressing further errors from this subtree.)
…widget-2" class="widget Social_Widget"><div class="socialmedia-buttons smw_lef…
Contexts in which element li may be used:
Inside ol elements.
Inside ul elements.
Inside menu elements whose type attribute is in the toolbar state.
Content model for element div:
Flow content.

我发现它上面安装了一个社交媒体小部件插件..但我找不到它的具体位置,我找到了social-widget.php,但仍然无法找到这一行:

<li id="social-widget-2" class="widget Social_Widget"><div class="socialmedia-buttons smw_left"><a href="https://www.facebook.com/JustSimplyOutsourcingWorldwideInc" rel="nofollow" target="_blank"><img width="32" height="32" src="http://www.justsimplyoutsourcingworldwide.com/wp-content/plugins/social-media-widget/images/default/32/facebook.png"
alt=" Facebook"
title=" Facebook" style="opacity: 0.8; -moz-opacity: 0.8;" class="fade" /></a><a href="https://plus.google.com/b/100887468338831289783/100887468338831289783/posts" rel="publisher" target="_blank"><img width="32" height="32" src="http://www.justsimplyoutsourcingworldwide.com/wp-content/plugins/social-media-widget/images/default/32/googleplus.png"
alt=" Google+"
title=" Google+" style="opacity: 0.8; -moz-opacity: 0.8;" class="fade" /></a><a href="https://twitter.com/JSOWorldwide" rel="nofollow" target="_blank"><img width="32" height="32" src="http://www.justsimplyoutsourcingworldwide.com/wp-content/plugins/social-media-widget/images/default/32/twitter.png"
alt=" Twitter"
title=" Twitter" style="opacity: 0.8; -moz-opacity: 0.8;" class="fade" /></a><a href="http://www.linkedin.com/company/just-simply-outsourcing" rel="nofollow" target="_blank"><img width="32" height="32" src="http://www.justsimplyoutsourcingworldwide.com/wp-content/plugins/social-media-widget/images/default/32/linkedin.png"
alt=" LinkedIn"
title=" LinkedIn" style="opacity: 0.8; -moz-opacity: 0.8;" class="fade" /></a><a href="http://instagram.com/jsoworldwide/" rel="nofollow" target="_blank"><img width="32" height="32" src="http://www.justsimplyoutsourcingworldwide.com/wp-content/plugins/social-media-widget/images/default/32/instagram.png"
alt=" Instagram"
title=" Instagram" style="opacity: 0.8; -moz-opacity: 0.8;" class="fade" /></a><a href="http://pinterest.com/jsoworldwide/" rel="nofollow" target="_blank"><img width="32" height="32" src="http://www.justsimplyoutsourcingworldwide.com/wp-content/plugins/social-media-widget/images/default/32/pinterest.png"
alt=" Pinterest"
title=" Pinterest" style="opacity: 0.8; -moz-opacity: 0.8;" class="fade" /></a><a href="http://www.youtube.com/user/JSOutsourcingWw" rel="nofollow" target="_blank"><img width="32" height="32" src="http://www.justsimplyoutsourcingworldwide.com/wp-content/plugins/social-media-widget/images/default/32/youtube.png"
alt=" YouTube"
title=" YouTube" style="opacity: 0.8; -moz-opacity: 0.8;" class="fade" /></a></div></li>

通过检查元素可以看到这段代码..我需要找到那条线,但我无法在social-widget.php中找到它。请帮助

1 个答案:

答案 0 :(得分:1)

根据错误消息,我猜您在div标签内使用li标签是错误的,请仔细检查您的代码

您尝试这样做

   <div>
        <li></li>
        <li></li>
        <li></li>
   </div>

li必须位于olul标记内

   <div>
        <ol>
            <li></li>
            <li></li>
            <li></li>
        </ol>
   </div>