简体   繁体   English

图像无法使用 img 标签在 html 中显示

[英]image not able to showing using img tag inhtml

I facing the issue ie, i want to show image in my html page so i used img tag in that i give img src but i am not able show the image.我面临这个问题,即我想在我的 html 页面中显示图像,所以我使用了 img 标签,因为我给了 img src 但我无法显示图像。

this is the my image path in my system C:\\Users\\sp\\Desktop\\UI developement_HTML_Daily practice samples\\image.png这是我系统中的图片路径 C:\\Users\\sp\\Desktop\\UI development_HTML_Daily practice samples\\image.png

 <!DOCTYPE html> <html> <head> <title>Using Image in Webpage</title> </head> <body> <p>Simple Image Insert</p> <img src="image.png" alt="Test Image" /> </body> </html>

If you want to deploy this site, you should deploy the image as well.如果要部署此站点,则还应部署映像。

I suggest (as kind of a best practice approach) you create a folder images or pics in the same directory as your index.html file.我建议(作为一种最佳实践方法)在与 index.html 文件相同的目录中创建一个文件夹imagespics Copy your picture into this folder and then use the link:将您的图片复制到此文件夹中,然后使用链接:

<img src="images/image.png" alt="Test Image">

That way you can easily deploy your project folder in the future and will have all files properly linked.这样,您可以在将来轻松部署项目文件夹,并将所有文件正确链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM