Home  >  Article  >  Web Front-end  >  chrome 、 火狐等浏览器对空格符  解析不同,页面显示不一致 - LIUTX

chrome 、 火狐等浏览器对空格符  解析不同,页面显示不一致 - LIUTX

WBOY
WBOYOriginal
2016-05-21 08:54:301925browse

最近初学web,从头开始,菜鸟级别,遇到的小问题记录下来。

  网上资料说 空格在iefirefoxchrome浏览器上显示的效果不太一样,主要是前面的空格宽度不同,这可能是因为不同的浏览器会有不同的默认字体,一般 IE默认字体都是宋体
firefoxchrome的默认字体是Times New Roman 宋体是字符等宽的字体,但Times New Roman不是字符等宽的字体,因为浏览器默认字体的不同,空格符
在不同的浏览器下面的显示宽度也不同。

  解决方案,有建议使用span元素结合间距来实现空格效果。自己也测试了一下,感觉甚好,

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn