Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图片删除后的显示问题,建议显示alt-text #1

Open
gMan1990 opened this issue Dec 26, 2020 · 3 comments
Open

图片删除后的显示问题,建议显示alt-text #1

gMan1990 opened this issue Dec 26, 2020 · 3 comments

Comments

@gMan1990
Copy link

gMan1990 commented Dec 26, 2020

比如这张图,图已删除,本来应该显示有用的alt信息,但现在是一张默认404图片

![有用的alt信息](https://i.loli.net/2020/12/26/KEBAXzwRanMC3bg.png)

@Showfom
Copy link
Contributor

Showfom commented Dec 26, 2020

为什么要显示有用的 alt 信息?已经在数据库里删除了,除了删除图片的 hash 值,不保留图片的其他信息

@gMan1990
Copy link
Author

gMan1990 commented Dec 26, 2020

@Showfom 你比如说![这是张皮卡丘图](https://i.loli.net/2020/12/26/KEBAXzwRanMC3bg.png),(图片已被删,你可以贴到其它地方看效果)

  1. 还是可以访问到,但显示为404样式图片(这样我看着网页显示完全不知道该图是什么东西
  2. 不能访问到,http status = 404 (这样网页会显示出alt值,那我就知道该图表达的是皮卡丘

这也是alt属性的本意 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-alt

Defines an alternative text description of the image.

Note: Browsers do not always display images. There are a number of situations in which a browser might not display images, such as:
...
In these cases, the browser may replace the image with the text in the element's alt attribute. For these reasons and others, provide a useful value for alt whenever possible.

@Showfom
Copy link
Contributor

Showfom commented Dec 27, 2020

你说的很有道理,建议接受,但是我们懒得改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants