Unfortunately, CSS cannot calculate the width of the lines and does not have access to text content ... If you used monospace fonts, you could calculate the width manually based on the font size, but this would still be a bad solution.
Negative margins, indents, etc. unreliable, since we have no idea how fonts are rendered, which means that all of them can break and look ugly in different browsers under different zoom levels, etc.
Bottom line: Only CSS cannot do this.
source share