Spaces are displayed differently in ie, firefox, and chrome browsers, mainly because the width of the leading space is different. This may be because different browsers have different default fonts, generally, the default fonts of IE are all. Below we will introduce several good solutions. The display effects on ie, firefox, and chrome are not the same, mainly because the front space width is different.
Online Information
Different browsers have different default fonts. Generally, the default fonts of IE are, while those of firefox and chrome are Times New Roman,
Is an equal-width font, but Times New Roman is not an equal-width font, because the default font of the browser is different,
The display width of the space character varies with the browser.
For example, the following code uses IE and chrome to test
The Code is as follows:
I am the first line |
Nbsp; I am the second line |
Nbsp; I am the third line |
The effect on chrome is as follows:
In IE9, the following results are displayed:
We can see that two characters occupy the width of one Chinese Character in chrome, and four characters occupy the width of one Chinese Character in IE.
Solution:
1. Modify the page encoding format
And page compilation method (in myeclipse)
Right-click IE and modify the encoding display format.
2. (recommended) set the font on the line of space and set the font to any Character spacing.
For example:
The Code is as follows:
Nbsp; I am the second line
PS: nbsp; Replace