Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove the space between a character in HTML? Padding doesn't work

enter image description here

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>
like image 704
Mohammed H Avatar asked Apr 21 '12 14:04

Mohammed H


2 Answers

That space is part of the font. Use a negative letter-spacing margin-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.

like image 69
Madara's Ghost Avatar answered Nov 19 '22 11:11

Madara's Ghost


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>

enter image description here

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

like image 42
Eduardo Molteni Avatar answered Nov 19 '22 12:11

Eduardo Molteni