When I try to create a square root using the √ code and overline, this generally works until I introduce tags, such as in the following:
v<sub>1</sub> = √<span style="text-decoration:overline">2g(y<sub>2</sub> - y<sub>1</sub></span>
I’m not sure if this will work, but I think you can see what I’m seeing with this: https://jsfiddle.net/gmf3qnha/
Basically, the overline is both broken and lower above the "2" and the "1" within sub tags. It’s pretty clear why it’s rendering this way, but of course the ideal is to show the equation under an unbroken square root line. Anyone know a good way to accomplish this? I don’t guess I can tell the style to ignore the internal tagging structure, but it seems like this should be achievable within a page using plain old HTML and CSS. Is that not the case?
2
Answers
Maybe you want bit like this
Here’s a solution to your problem, albeit there could be a better approach, but I think this should be good enough. I’ve enclosed the entire equation into a
div
element just to organize it better. Rest of everything is almost same as yours but tidied up. I used anotherdiv
element within for the overline part and gave it thedisplay: inline;
styling so it’d appear next to the radical symbol, gave it a top border of 1 pixels, usedRGBA
color format and gave black an alpha of 0.5, so it’d match the color of the radical sign. Margin left to get rid of the spacing and so the radical and the overline don’t look disconnected. Then used margin left again to add spacing to the left of the numbers.