首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在此上下文中,元素li不允许作为元素div的子元素。(抑制此子树中的进一步错误。)

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

Stack Overflow用户
提问于 2014-09-09 07:56:46
回答 1查看 3.9K关注 0票数 1

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

代码语言:javascript
复制
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.

我在it..but上找到了一个安装在社交媒体小部件上的插件--我找不到它的具体位置,我找到了社会化-widget.php,但仍然找不到这一行:

代码语言:javascript
复制
<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>

这段代码是通过检查元素看到的。我需要找到那一行,但我在社交网站-widget.php中找不到。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-09 08:32:26

根据错误消息,我猜您在div标记中使用了li标记,这是错误的,请仔细检查代码。

你试着做这个

代码语言:javascript
复制
   <div>
        <li></li>
        <li></li>
        <li></li>
   </div>

ol li必须在 ul ul标记中。

代码语言:javascript
复制
   <div>
        <ol>
            <li></li>
            <li></li>
            <li></li>
        </ol>
   </div>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25739385

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档