IMG标签不起作用,而是背景图像工作
我正在使用Angular 14和ASP.NET 6 背景图像工作,但IMG标签不起作用。我该如何解决这个问题?
bankSearch.html
<body>
<div class="container">
<img src="res/hand.png" alt="hand" width="200"/>
</div>
</body>
bankSearch.css
body {
background-image:url("res/hand.png");
background-color: #F3F3F3;
background-size:auto;
}
I'm using Angular 14 and ASP.NET 6
background-image working but img tag not working. How can I solve this problem?
BankSearch.html
<body>
<div class="container">
<img src="res/hand.png" alt="hand" width="200"/>
</div>
</body>
BankSearch.css
body {
background-image:url("res/hand.png");
background-color: #F3F3F3;
background-size:auto;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我正在使用Angular 14,实际上这个问题来自Angular。源的角度外观资产/文件夹。
我解决了这样的问题。我将Res文件夹移至资产文件夹。我的工作代码:
I'm using Angular 14 and actually this problem coming from Angular. Angular looking assets/ folder for source.
I solved this problem like this; I moved my res folder to assets folder. My working code: