我做了以下步骤:
- 安装的 Node.js
- 在cmd中,写: npm install http-server -g
- cd user/me/local 我的网站文件在哪里
- 在谷歌浏览器中,输入:localhost:8080
在 localhost8080 我打开我的 html 文件以查看我的网站的外观。所有的图像都消失了。在我的 html 文件中,我写道:<img src="imagens/karla.jpg" />
但我猜我的 C 驱动器无法访问,所以不显示图像。我试过了<img src="http://localhost:8080/imagens/karla.jpg" />,但还是不行。但是链接 http://localhost:8080/imagens/karla.jpg 工作并且图像在那里。
注意:当我运行 Visual Studios 来测试我的网站时,它工作正常。我的本地主机8080:

编辑:嗯......一切都很好,是我在chrome中的暗模式扩展使我所有的图像变黑......对不起