【问题标题】:Problem with embedded SVG height in IE8IE8 中嵌入的 SVG 高度问题
【发布时间】:2011-09-06 03:17:38
【问题描述】:

我的 html 网页中嵌入了一个大型 SVG 文件(1100x44000 像素)。我的代码在 Firefox 4 上运行起来就像一个魅力,但在带有 Adob​​e 插件的 IE8 上无法正确显示。

更准确地说,当我将我的 SVG 嵌入到 EMBED(或 IFRAME)标签中时,对于属性 height

我知道 IE8 与 SVG 存在兼容性问题。我在 IE 上尝试了“兼容性视图”并尝试添加,但没有帮助。

任何帮助表示赞赏:)

这里是代码的摘录:

<table style="width:1100px;">
 <tr>
      <td colspan="2">
    <div class="title" >data</div>
   </td>
</tr>
<tr>
  <td colspan="2">
    <div id="DivCont"   class="SVG_container">  
      <embed src="./NC_012587/out.svg" style="margin-top:30px; overflow:hidden;"  width="1100" height="44000" />
   </div>
  </td>
</tr>

一些 CSS:

tr{
    width:1100px;
}

td{
border:1px solid #dfdfdf;
}

td.box{  
  background-color: #f5eded; 
  margin-top: 0px;
  top: 0px;
  height: 200px;
}

div.SVG_container{
 height:600px;
 width:1100px;
     overflow:scroll;
 position:relative; 
}

rect.select_div{
position: absolute;
height: 30px;
width: 98px;
background: #CCF;
border: 1px solid #AAD;
text-align: center;
font-size: 10px;
border:1px solid black;
  /* for IE */
filter:alpha(opacity=60);
 /* CSS3 standard */
opacity:0.6;    
}   

【问题讨论】:

  • 既然您已经知道 IE8 根本不支持 SVG(我已经在上一个问题中告诉过您),您应该指定您使用什么产品来添加 SVG 支持。问题可能出在那个产品上,而不是 IE8。
  • 它如何与 Chrome 一起使用?除了使用 Adob​​e 插件,也许您可​​以建议人们使用 Google Chrome Frame。

标签: html internet-explorer iframe svg embed


【解决方案1】:

尝试使用&lt;object&gt; 标签而不是&lt;embed&gt;。对我来说,对象标签在 IE8 中工作。它可能有一些问题,但基本上它会显示 SVG。

【讨论】:

    猜你喜欢
    • 2016-11-24
    • 2019-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-13
    • 2016-03-12
    相关资源
    最近更新 更多