Whenever letter-spacing is applied to something with an underline or a bottom border, it seems like the underline extends beyond the text on the right. Is there any way to do prevent the underline from extending beyond the last letter in the text?
For example:
<span style="letter-spacing: 1em; border-bottom: 1px solid black;">Test</span>
Perhaps it’d be possible with a fixed width <div> and a border, but that is really not an option to surround every underlined element.
Thanks!
The problem is that “letter-spacing” adds space by adding white space after each letter, but this space belongs to the letter, and thus the last one has an extra underline that makes it look like it’s expanding beyond the last letter (if you select with the mouse the last letter of the div, you’ll see what I mean).
You could solve it by having the last letter of the text block not having the “letter-spacing” property. For example:
It’s far from ideal, but unless it’s just a one line text (there, you could use a negative margin to the right), I can’t think of any other solution.