Browser will not display image

2019-09-16 13:15发布

问题:

I'm building a simple website example where I added an image. I'm using textedit on mac. However, special characters are being added to the file when I look in Chrome's inspector.

In textedit I type

<img src =“images/nicole.png”>

But it displays as

<img src="“images/nicole.pngâ€""> 

Why is this happening?

回答1:

The quote you are currently using is a Unicode version (Most likely the Chinese version). That's why it is showing as those weird chars. Try to copy and paste this " into your code instead of typing them in should fix it. You might want to check your IME setting or text editor setting to prevent it in the future.



回答2:

In the TextEdit preferences (TextEdit menu > Preferences), uncheck "Smart quotes" under Options.

You will have to go through and replace all of them.