Mathjax线路破坏问题

时间:2018-06-10 11:13:27

标签: html css math mathjax

早上好, 我使用MathJax来显示数学问题。我想在一行中显示两个问题,并使用 span 进行修剪。



p.problems span.third {
  width: 33%;
  float: left
}

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML" async></script>

<br><br>Required solution with span on one line<br><br>

<p class="problems"><span class="third">a) \(ax^2 + bx + c = 0\)</span> <span>b) \( x = {-b \pm \sqrt{b^2-4ac} \over 2a} \)</span></p>

<br><br>it should be on one line<br><br>
<p class="problems">a) \(ax^2 + bx + c = 0\)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b) \( x = {-b \pm \sqrt{b^2-4ac} \over 2a} \)</p>
&#13;
&#13;
&#13;

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

您可以使用display:flexalign-items: center;

来解决此问题

p.problems span.third {
  width: 33%;
  float: left
}
p.problems {
  display: flex;
  align-items: center;
}
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML" async></script>

<br><br>Required solution with span on one line<br><br>

<p class="problems"><span class="third">a) \(ax^2 + bx + c = 0\)</span> <span>b) \( x = {-b \pm \sqrt{b^2-4ac} \over 2a} \)</span></p>