问题
Why is there space(marked in red color) before the letter 'അ', even if I added padding as 0px?
<span style="margin:0;padding:0;border:1px solid blue;font-size:128px">അ</span>
回答1:
That space is part of the font. Use a negative letter-spacingmargin-left on it in order to remove it.
Example
Note: this only moves the entire span a few px back. In reality, the space is still there and cannot be properly removed.
回答2:
In typography, spacing between characters is often adjusted due to esthetic and readability considerations. The spaces are there even in common ascii letters:
<span style="margin:0;padding:0;border:1px solid blue;font-size:128px;letter-spacing:0px;">a</span>
But the space is different because of different variables like what is the previous and next character.
You can achive some results by playing with negative padding and letter-spacing
More info
回答3:
White spaces occur from working with inline positioning and spans are always inline elements. Solution here: https://css-tricks.com/fighting-the-space-between-inline-block-elements/
Have you looked at lettering.js? Its a jquery plug-in that works specifically for typography.
来源:https://stackoverflow.com/questions/10259888/how-can-i-remove-the-space-between-a-character-in-html-padding-doesnt-work