You would be better off replacing MathML with SVG rather than HTML-CSS. HTML-CSS MathJax output is different for different browsers, operating systems, font sizes, and several other factors, so if you save HTML code generated for one situation, it may not work correctly for another. SVG output is consistent across browsers.
There are people who have already worked on this. The svgtex project is one. Wikipedia developed Mathoid to do something similar.
source
share