2016-04-06 40 views
1

我想渲染SVG的mathml。 它在Chrome上看起來很好,但在IE中svg具有附加屬性到它的標記我們如何避免添加這些附加屬性? 請嘗試將mathml渲染爲Chrome和IE中的SVG。 你可以看到SVG標籤,它得到了生成(附scrrenshots兩個瀏覽器)的區別SVG渲染不適合在IE瀏覽器中

MathML是:

<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mn style="font-family: inherit;font-style: inherit;" ID="63201617503163">1</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503164">2</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503165">3</mn><mtable columnalign="right" align="baseline 2" rowspacing="0.0ex" ID="63201617503166"><mtr><mtd><mrow><mn style="font-family: inherit;font-style: inherit;" ID="63201617503167">1</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503168">2</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503169">3</mn></mrow></mtd></mtr><mtr><mtd><menclose notation="longdiv"><mrow><mn style="font-family: inherit;font-style: inherit;" ID="63201617503170">1</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503171">2</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503172">3</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503173">4</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503174">5</mn></mrow></menclose></mtd></mtr><mtr><mtd><munder><mrow><mn style="font-family: inher[enter image description here][2]it;font-style: inherit;" ID="63201617503175">1</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503176">2</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503177">3</mn></mrow><mrow><mo>_</mo></mrow></munder><mphantom><mrow><mn>45</mn></mrow></mphantom></mtd></mtr><mtr><mtd><mrow><mn style="font-family: inherit;font-style: inherit;" ID="63201617503178">1</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503179">2</mn><mn style="font-family: inherit;font-style: inherit;" ID="63201617503180">3</mn></mrow></mtd></mtr></mtable></mrow></math> 

enter image description here

enter image description here

+0

你應該添加一個現場演示。 –

回答

1

請注意,這些屬性也第一個圖形,但它們更靠右(請注意位於包含<svg>元素的行右側的style="width: 10.751ex; height: 12.291ex...。) IE的輸出應該與所有其他瀏覽器完全相同(屬性的模數順序),因爲SVG輸出確實包含任何瀏覽器特定的代碼。

樣式對於獲取正確的位置非常重要。如果展示位置對您而言不正確,則頁面上可能存在其他干擾的CSS。您可以嘗試修改您的頁面,以便它不加載任何CSS並查看SVG輸出是否正確。如果是這樣,那麼一次只添加一個CSS文件,直到找到問題所在。然後仔細觀察,看看有什麼可能是錯的。

否則,正如彼得建議的那樣,爲我們提供一個實況樣本來看看。另外,你暗示IE輸出在視覺上不是正確的,但並不是說以何種方式(例如,屬性的不同與說明屏幕上顯示的結果或提供屏幕截圖不同)。