首页 > V2EX > V2EX-img 标签到底需要关闭吗?
2022
06-23

V2EX-img 标签到底需要关闭吗?

iceice121:

偶然看到这个 Tag omissionMust have a start tag and must not have an end tag.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#technical_summary

同类的还有 input

F12 查看渲染出来的 img 也是没有关闭的,所以我就去看了看几个常用的 UI 框架文档

https://ant.design/components/card-cn/ (关闭)

https://element-plus.org/zh-CN/component/card.html#%E6%9C%89%E5%9B%BE%E7%89%87%E5%86%85%E5%AE%B9%E7%9A%84%E5%8D%A1%E7%89%87 (关闭)

https://quasar.dev/vue-components/avatar (未关闭)

https://mui.com/zh/material-ui/react-image-list/ (关闭)

那么问题来了,既然都能正常渲染,到底谁才是对的?

from V2EX-最新主题 https://ift.tt/KIjbuPl
V2EX-img 标签到底需要关闭吗? - 第1张  | 牛叻网(NiuL.Net)

最后编辑:
作者:分享菌
这个作者貌似有点懒,什么都没有留下。

留下一个回复