2016-04-06 105 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输出在视觉上不是正确的,但并不是说以何种方式(例如,属性的不同与说明屏幕上显示的结果或提供屏幕截图不同)。