我正在尝试为mathml呈现SVG。它在chrome上看起来很好,但在IE中,svg的标签有额外的属性,我们如何避免添加这些额外的属性呢?请尝试将下面的mathml渲染为chrome和IE中的SVG。你可以看到生成的SVG标签的不同之处(在两个浏览器中附加的截图)
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>


发布于 2016-04-07 06:21:14
请注意,这些属性也在第一个图形中,但它们更靠右(请注意包含<svg>元素的行右侧的style="width: 10.751ex; height: 12.291ex... )。IE的输出应该与所有其他浏览器的输出完全相同(属性的模数顺序),因为SVG输出确实包含任何特定于浏览器的代码。
样式对于正确放置非常重要。如果位置不适合您,页面上可能有其他CSS干扰。您可以尝试修改页面,使其不加载任何CSS,并查看SVG输出是否正确。如果是,则一次添加一个CSS文件,直到找到问题所在的文件。然后仔细检查一下,看看可能的错误是什么。
否则,就像Peter建议的那样,提供一个活生生的样本供我们查看。此外,您还暗示IE的输出在视觉上不正确,但没有说明以何种方式(例如,说属性不同就不同于说结果在屏幕上看起来是什么样子,或者提供屏幕截图)。
https://stackoverflow.com/questions/36451291
复制相似问题