IE8中嵌入式SVG高度的问题

时间:2011-06-01 09:24:33

标签: html internet-explorer iframe svg embed

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

更确切地说,当我将SVG嵌入到EMBED(或IFRAME)标记中时,对于属性 height = 16382 px的所有值,它的效果都很好,但是高于此值,内容为根本没有显示!

我知道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;    
}   

1 个答案:

答案 0 :(得分:1)

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