How do I fix the width and height of my latex math term?
I am currently coding an interactive web function where I can click on the latex math term and it'll cancel to zero. However, right now, it is a bit jumpy/glitchy because the size of the first math term changes (highlighted in orange as shown in the picture) once the user clicks on it.


Is there a way where I can set the width and height of the orange box to constant width before and after clicking?
<p>
<span class="special">Mass Continuity Equation:</span>
<span class="first" id="first" data-click-state="1">\({{\partial \rho} \over {\partial t}}\)</span>
<span id="second">\(+\)</span>
<span id="third" data-click-state="1">\({{\partial u} \over {\partial x}}\)</span>
<span id="symbol"> \(+\) </span>
<span id="fourth" data-click-state="1"> \({{\partial v} \over {\partial y}}\)</span>
<span id="fifth">\(+\)</span>
<span id="sixth" data-click-state="1"> \({{\partial w} \over {\partial z}}\) </span>
<span id="seventh">\(= 0\)</span>
</p>
After user clicks the first term, this will be rendered:
<p>
<span class="special">Mass Continuity Equation:</span>
<span class="first" id="first" data-click-state="0">\(\require{cancel}\cancelto{0} {{\partial \rho} \over {\partial t}}\)</span>
<span id="second">\(+\)</span>
<span id="third" data-click-state="1">\({{\partial u} \over {\partial x}}\)</span>
<span id="symbol"> \(+\) </span>
<span id="fourth" data-click-state="1"> \({{\partial v} \over {\partial y}}\)</span>
<span id="fifth">\(+\)</span>
<span id="sixth" data-click-state="1"> \({{\partial w} \over {\partial z}}\) </span>
<span id="seventh">\(= 0\)</span>
</p>
CSS code:
p { font-size: 30px;}
Codepen: