关于的信息标签
我已将 Aptana 升级到版本 3。从那时起,我收到如下警告:
<a><span id="contacts" rel="#overlayTest">Contact</span></a>
Multiple markers at this line:
- should discard unexpected <a>
- should discard unexpected </a>
A。在“div”或“span”之前放置“a”标签是否违法?
编辑: 我遇到了错误,因为我没有在 a 标记内放置 href。
我还会收到如下警告:
<a class="pointer"><li class="spacing5px">Journal</li></a>
Multiple markers at this line:
- should discard unexpected </a>
- missing <li>
- missing </a> before <li>
B。是我瞎了还是真的有问题?
顺便说一句,我的页面加载完美。这些只是警告,但它让我烦恼。
谢谢!
I have upgraded Aptana to version 3. Since then, I get warnings like:
<a><span id="contacts" rel="#overlayTest">Contact</span></a>
Multiple markers at this line:
- should discard unexpected <a>
- should discard unexpected </a>
A. Is it illegal to put an "a" tag before a "div" or a "span"?
EDIT : I had the error because I put no href inside the a tag.
I also get warnings like:
<a class="pointer"><li class="spacing5px">Journal</li></a>
Multiple markers at this line:
- should discard unexpected </a>
- missing <li>
- missing </a> before <li>
B. Am I blind or there is really something wrong here?
Btw, my page loads perfectly. Those are just warnings, but it bugs me.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 HTML 5 之前,您不能将 div 放入锚点内(而且我很长一段时间都不会这样做,因为浏览器需要太多的技巧来处理它)。
您不能将列表项放置在可以放置锚点的任何位置,反之亦然。 (因此锚点不能是列表的子元素,并且列表项不能是锚点的子元素)。我不确定 HTML 5 是否会改变这一点。
另外:
You cannot put a div inside an anchor until HTML 5 (and I wouldn't do so for a long time as it needs too much hackery for browsers to handle it).
You can't put a list item anywhere that you can put an anchor and vice versa. (So an anchor cannot be a child element of a list, and a list item cannot be a child element of an anchor). I'm not sure if HTML 5 will change this or not.
Also:
锚点是内联元素,因此它们应该位于块级元素内部,包括
li
和div
元素。不过span
应该没问题。Anchors are inline elements, so they should go inside block level elements, including
li
anddiv
elements. Thespan
should be OK though.