cool hit counter &nbsp(located) atIE harmonyFireFox The inconsistency is shown in_Intefrankly

&nbsp(located) atIE harmonyFireFox The inconsistency is shown in


Copyright: This is an original post by the blogger and may not be reproduced without the blogger's permission. https://blog.csdn.net/huyuyang6688/article/details/38704045

&nbsp(located) atIE harmonyFireFox The inconsistencies shown in

While working on the backend login screen of the press release system, For the sake of aesthetics, want to work in“ pin number” Add a space between the two words, thereby allowing“ user ID”、“ close code”、“ CAPTCHA, a type of challenge-response test (computing)” Vertical alignment。

So the code was added with two“ ”,(located) atFireFox It's having the desired effect.:

We all know that., an“ ” is a character size。 But I was already in“ pin number” Two words have been added between the two“ ” finish, Exactly one Chinese character apart。 But inIE Results of the test in the browser,“ pin number” The spacing between the two words is still very small( It's about the size of a character)。 I'll keep adding“ ”,IE in“ pin number” The spacing between the two characters remains the same, It's still only about the size of a character, No matter how many additions of  markers, It seems to show only one space at most; but (not)FireFox The length of the added spaces is dutifully displayed in。

reason

ascertain reason only afterwards, This is caused by the different default fonts in each browser, generalIE The default font forSimsun,FireFox The default font is Song16 bugle call, And when displaying spaces, The browser will also display spaces in that font format according to its own default font, This has resulted in the above“ Different browsers display the  different length” existing issues。

IE browser default font.

FireFox browser default font.

Solution.

Knowing the cause, the solution is very simple.

The first method: Just set the font in the code for the words in the block in question, For example, here the above needs to be formatted“ close code” The font is set to Song:

font-family :" Song font" ;

Of course setting it to other fonts such as italics or scripts is fine.

Setting the font here needs a little clarification, In some of the fonts set, Not necessarily one.  A space equal to the length of one character, for example:Times New Roman, four  It's only the length of a character, that's why, About some other fonts, It still needs to be explored with practice。

The second method : change the font in the browser, but this seems to be a cover-up →_→, we made the program for everyone to use, we can not let each user to modify their own browser, so this method is not recommended to "fool yourself".

I realized through writing this blog that there is a great deal of wisdom in a small space. We need to capture every detail and make foolproof systems in the spirit of serving people's names wholeheartedly.


Recommended>>
1、You know when and when not to use Redux
2、For everyones benefit li use Python to climb down all the girls on a certain website
3、Platform to banks and other financial institutions AI big data and nonperforming assets disposal will better help its smooth and healthy development in 2018
4、Red Flag unveils new brand concept but netizens dont buy it
5、EU cybersecurity bill building a universal cybersecurity certification system

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号