I have a span
positioned as absolute
inside a div
(with top
and left
values set). The span is connected to user input and when the user inputs text the span exands with the given text towards the right to contain the text, but I'd like it to grow in both sides, which means when user inputs a word of 7 characters, the character in order #4 should be in the exact center.
Is there anyway to achieve this in pure CSS? or a way to mutate the value of left
using JS but with decent accuracy.