I have an element of initially unknown width, in particular, the MathJax equation provided by the user. I have an element installed as an inline unit to ensure that the width of the element matches its contents and therefore has a specific width. However, this prevents traditional centering methods. That is, the following does not work:
.equationElement { display: inline-block; margin-left: auto; margin-right: auto; }
And the solution cannot be:
.equationElement { display: block; width: 100px; margin-left: auto; margin-right: auto; }
Because I have no idea what the width should actually be in advance, and if the user clicks on the equation, I need the whole equation to be selected, so I can not set the width to 0. Does anyone have a solution for centering of this equation?
css mathjax
Deets McGeets Sep 29 '11 at 18:20 2011-09-29 18:20
source share