;仅在 IE8 中标签错误?
为什么我的 img 标签在 IE8 中不起作用?但在ff?和铬?
validation Output: 2 Errors
Line 17, Column 47: an attribute value literal can occur in an attribute specification list only after a VI delimiter
"<img src="images/helhjartat_slutliga.jpg" alt"logga">"
✉
Have you forgotten the "equal" sign marking the separation between the attribute and its declared value? Typical syntax is attribute="value".
Line 17, Column 48: end tag for "img" omitted, but OMITTAG NO was specified
"<img src="images/helhjartat_slutliga.jpg" alt"logga">"
✉
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 17, Column 2: start tag was here
"<img src="images/helhjartat_slutliga.jpg" alt"logga">"
Why won´t my img tag work in IE8? but IN ff? and chrome?
validation Output: 2 Errors
Line 17, Column 47: an attribute value literal can occur in an attribute specification list only after a VI delimiter
"<img src="images/helhjartat_slutliga.jpg" alt"logga">"
✉
Have you forgotten the "equal" sign marking the separation between the attribute and its declared value? Typical syntax is attribute="value".
Line 17, Column 48: end tag for "img" omitted, but OMITTAG NO was specified
"<img src="images/helhjartat_slutliga.jpg" alt"logga">"
✉
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 17, Column 2: start tag was here
"<img src="images/helhjartat_slutliga.jpg" alt"logga">"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您忘记了等于并关闭标签
You forgot the equals and closing the tag
您在
alt
之后缺少一个等号,对于 XHTML,您应该适当地关闭 img 标签:You are missing an equal sign after
alt
and for XHTML you should close the img tag approprietly:据猜测,您已将
DOCTYPE
设置为严格 XHTML,这意味着您的img
标记的格式不正确,请尝试更改DOCTYPE
> 到更宽松的版本,或修改你的 img 标签..At a guess, you've set your
DOCTYPE
to strict XHTML, which means yourimg
tag isn't correctly formed, try either changing theDOCTYPE
to a more loose version, or amend your img tags..首先,您必须编写 alt="logga" 而不是 alt"logga"
,其次您必须关闭标签。
您可以通过将尾随 > 替换为 />(可以选择添加更多空格)来直接关闭标记
,也可以提供结束标记
为什么它可以在 FF 和 Chrome 中运行?
因为它们比 - 在本例中 - IE8 慷慨得多,
我希望这能回答你的问题;)
如果我问错了你的问题,请原谅我
first of all you have to write alt="logga" and not alt"logga"
and secondly you have to close your tag.
either you close you tag directly by replacing the trailing > with /> (optionally add a further space)
or you provide the closing tag
why is it working in FF and Chrome?
Because they are much more generous than - in this case - IE8
I hope this answers your question ;)
If i got your question wrong, please forgive me