Hidden characters in CSS

后端 未结 2 1278
傲寒
傲寒 2021-01-20 15:42

I have been hours with a code that did not work and I could not find the problem. I simplified the problem to find it. At the end I find a hidden character, a character I co

相关标签:
2条回答
  • 2021-01-20 16:00

    The character is a UTF-8 zero-width space: e2 80 8b. When the CSS parser reaches this character, it stops reading the file.

    The solution is just to not put these in in the first place. They aren't valid as part of CSS. If you have existing ones you need to remove, you can open the file with a hex editor to identify their positions.

    0 讨论(0)
  • 2021-01-20 16:10

    After trying a lot of things. I find two free editors that show the error:
    - TextWrangler: If I go to view > text display > show invisibles it shows a red ​¿ that is easy to delete.
    - Aptana Studio: shows a red cross in the border and a point in the place with the white space.

    I still don't know how or why this white spaces appear. For me was an important problem because it can collapse a project and there is no way to see it in my current editor Dreamweaver, no matter wich version I try. This white space cannot be detected either in collaborative tools like JsFiddle, Jsbin, CodePen or Dabblet.

    As I said TextWrangler and Aptana are a easy to use and free way to solve it. If anyone can tell another editor or easy way to see it for non experts like me, it would be good to know.

    0 讨论(0)
提交回复
热议问题