0

&#65279 引发奇怪的空白

 2 years ago
source link: https://www.jlao.net/technology/10595/?amp%3Butm_medium=rss&%3Butm_campaign=65279-is-the-culprit-for-mysterious-white-gaps
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用 Visual studio 编辑 html 时,发现页面上会出现奇怪的、CSS 无法消除的空白。在折腾了几个小时后,我发现浏览器查看元素时会有一些“


”。

这些字符就是所谓的字节顺序标记(byte order marks,BOMs),这个字符是“零宽度不换行空格”。这种东西在 VS 编辑器中完全不可见(在 Word 里面打开显示隐藏标记的话会显示)。如果在 Word 里面替换的话,可以用 ^u8520 替换掉。

Visual Studio 在保存 UTF-8 文件时默认是 “with signature” 的,这就会保存 BOM 字符。

解决方法就是在 VS 中保存时选择编码 “UTF-8 without signature”。

正在加载……

Posted in 技术相关

发表评论 取消回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK