【发布时间】:2020-01-17 01:13:11
【问题描述】:
我只想显示存储在后端的图像。但是没有显示图像。我收到此错误:
downloadIcon.jpg:1 GET http://localhost:4200/assets/hepchat/images/downloadIcon.jpg 404 (Not Found)
我是这样做的:
return $"<a href = \"{baseUrl}api/Devices/GetDownload/{model.AttachmentKey}/\" class=\"msgdownload\"><img src='./images/downloadIcon.jpg' alt=\"Download\"/></a>";
我有一个这样的 css 类:
.msgdownload {
position: relative;
width: 50px;
height: 25px;
display: block;
}
.msgdownload::after {
content: '';
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
}
而且我不想在 css 类中做这样的事情:
background: url(../hepchat/images/download.jpg) no-repeat bottom;
因为那时我不能有替代文本,当找不到图像时。
谢谢。
【问题讨论】:
-
我做错了什么?谢谢你。我只有图像文件夹中的图像
-
有什么建议吗?谢谢
-
您将图像 URL 存储在哪里?你能告诉我你是如何将图像存储到你的文件夹中的吗?