<img/>标签只在IE8中出错了吗?

时间:2011-04-15 11:51:14

标签: image ie8-browser-mode

为什么我的img标签不能在IE8中运行?但IN 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 个答案:

答案 0 :(得分: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" />

答案 1 :(得分:0)

你在alt之后错过了一个等号,对于XHTML,你应该关闭img标签:

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

答案 2 :(得分:0)

猜测一下,您已将DOCTYPE设置为严格的XHTML,这意味着您的img代码未正确形成,请尝试将DOCTYPE更改为更松散的版本,或修改你的img标签..

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

答案 3 :(得分:0)

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

其次,你必须关闭你的标签。

要么直接用 /&gt; 替换尾随的&gt; 来关闭标记(可选择添加更多空格)

或者您提供结束标记

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

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