1

为什么我的 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">"
4

4 回答 4

1

您忘记了等号并关闭标签

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

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

<img src="images/helhjartat_slutliga.jpg" alt="logga" />
于 2011-04-15T11:55:04.960 回答
0

首先你必须写alt="logga"而不是alt"logga"

其次,您必须关闭标签。

您可以通过将尾随>替换为/>来直接关闭标签(可选地添加更多空格)

或者您提供结束标签

为什么它在 FF 和 Chrome 中工作?因为它们比 - 在这种情况下 - IE8 更慷慨

我希望这能回答你的问题;)如果我把你的问题弄错了,请原谅我

于 2011-04-15T12:04:36.937 回答
0

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

<img src="images/helhjartat_slutliga.jpg" alt="logga" />
于 2011-04-15T11:55:52.170 回答
0

猜测一下,您已将您的标签设置DOCTYPE为严格的 XHTML,这意味着您的img标签格式不正确,请尝试将其更改DOCTYPE为更宽松的版本,或修改您的 img 标签。

<img src="images/helhjartat_slutliga.jpg" alt="logga" />
于 2011-04-15T11:56:01.460 回答