I am running into a weird issue when attempting to create a css-triggered tooltip that hovers over a link. From my understanding, a standard way to horizontally center an absolutely positioned object is:
parent { position: relative }
child { position: absolute; left: 50%; transform: translateX(-50%) }
This works fine, but when the parent is an <a>
tag with a line break in the text, the child is no longer centered.
Here is a jsfiddle example of what I am talking about
Notice in the example, hovering over the top link "text\nuneventext" will produce a tooltip slightly to the right of center.
Meanwhile, hovering over the bottom link "text" will produce a perfectly centered tooltip.
Does anyone know how to fix the centering of the tooltip for the multi-line <a>
tag?