;仅在 IE8 中标签错误?

发布于 2024-11-01 17:48:44 字数 807 浏览 1 评论 0原文

为什么我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

听不够的曲调 2024-11-08 17:48:44

您忘记了等于并关闭标签

<img src="images/helhjartat_slutliga.jpg" alt="logga" />

<img src="images/helhjartat_slutliga.jpg" alt="logga" />

<img src="images/helhjartat_slutliga.jpg" alt="logga" />

You forgot the equals and closing the tag

<img src="images/helhjartat_slutliga.jpg" alt="logga" />

<img src="images/helhjartat_slutliga.jpg" alt="logga" />

<img src="images/helhjartat_slutliga.jpg" alt="logga" />
倥絔 2024-11-08 17:48:44

您在 alt 之后缺少一个等号,对于 XHTML,您应该适当地关闭 img 标签:

<img src="images/helhjartat_slutliga.jpg" alt="logga" />

You are missing an equal sign after alt and for XHTML you should close the img tag approprietly:

<img src="images/helhjartat_slutliga.jpg" alt="logga" />
迷鸟归林 2024-11-08 17:48:44

据猜测,您已将 DOCTYPE 设置为严格 XHTML,这意味着您的 img 标记的格式不正确,请尝试更改 DOCTYPE > 到更宽松的版本,或修改你的 img 标签..

<img src="images/helhjartat_slutliga.jpg" alt="logga" />

At a guess, you've set your DOCTYPE to strict XHTML, which means your img tag isn't correctly formed, try either changing the DOCTYPE to a more loose version, or amend your img tags..

<img src="images/helhjartat_slutliga.jpg" alt="logga" />
话少心凉 2024-11-08 17:48:44

首先,您必须编写 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文