svg文件没有在html中显示

时间:2013-11-11 19:35:43

标签: html5 svg

不会显示svg文件push pop.svg。 代码是:

<html>
<head>
</head>
<body style="background:black;color:white">

<h1>Primitive operations :-</>
<ol>
<li>Push :- Place the new item on stack.Value of top gets incremented by one.</li>
<li>Pop :- Remove the item from top of the stack.Value of top decreases by one.</li>
</ol>
<img src="pushpop.svg" alt="Kiwi standing on oval">

</body>
</html>

2 个答案:

答案 0 :(得分:0)

查看您的代码,我建议进行以下两次编辑。

关闭你的H1标签!听起来很简单,打开标签会产生连锁效应

此外,您没有doctype,具体取决于浏览器,这也可能影响svg。

试试此代码

<!DOCTYPE html>
<html>
<head></head>
<body style="background:black;color:white">

<h1>Primitive operations :-</h1>
<ol>
    <li>Push :- Place the new item on stack.Value of top gets incremented by one.</li>
    <li>Pop :- Remove the item from top of the stack.Value of top decreases by one.</li>
</ol>
<img src="pushpop.svg" alt="Kiwi standing on oval">
</body>
</html>

答案 1 :(得分:-1)

尝试:

<html>
<head>
</head>
<body style="background:black;color:white">

<h1>Primitive operations</h1>
<ol>
<li>Push :- Place the new item on stack.Value of top gets incremented by one.</li>
<li>Pop :- Remove the item from top of the stack.Value of top decreases by one.</li>
</ol>

<embed src="pushpop.svg" type="image/svg+xml" />
</body>
</html>

http://www.w3schools.com/svg/svg_inhtml.asp