[英]Firefox support for alignment-baseline property?

Does Firefox have any support at all for the alignment-baseline property? When I inspect (using Firebug) SVG elements for which the alignment-baseline property has been explicitly set, Firebug does not list this property at all (IOW it treats is as noise). No matter what value I assign to this property, the appearance of the displayed text never changes, further suggesting that FF ignores this property altogether.


(One other sign that FF's support for this property may be busted is that the link given in the page cited above for the CSS documentation for this property is dead-as-a-doornail.)

(FF对此属性的支持可能被破坏的另一个迹象是,上面引用的关于此属性的CSS文档的页面中给出的链接是死的 - 作为doornail。)

Assuming that, as it appears, FF does not support the alignment-baseline property, what is the value of this property that would most closely replicate FF's default behavior?


EDIT: For example, view this jsFiddle with both Chrome and FF; each line of displayed text displayed a highlighted word that has been produced with code of the following form:


<tspan style="alignment-baseline:alphabetic">alphabetic</tspan>

Note that all the lines look the same in FF, but not so in Chrome.


There are a few possible candidate values for this property to replicate FF's default behavior (namely, auto, alphabetic, mathematic, and inherit); unfortunately, this experiment cannot decide the matter, and it's not clear to me which of the possible options would match FF's default behavior in the greatest fraction of cases.


2 个解决方案



It seems that alignment-baseline is ment to be used only for portions of <text>, that is for elements tspan, tref etc. For the main <text> element use the dominant-baseline attribute.

似乎对齐基线仅用于 的部分,即元素tspan,tref等。对于主 元素,使用dominant-baseline属性。

(This is what @Tanel Eero wrote above as a comment. I'm re-stating it here so the question can get an accepted answer).

(这是@Tanel Eero在上面写的评论。我在这里重新陈述,所以这个问题可以得到一个可接受的答案)。



The Mozilla Developer Network website states that the style can only be used on certain elements:


The following elements can use the alignment-baseline attribute



So that seems to be your main issue as I understand that you are trying to apply it to a SVG.




© 2014-2019 粤ICP备14056181号