使用一般的关闭图标类,关闭 modals 元件和 alerts 元件之类的内容。.
请务必为屏幕阅读器添加文本,我們可以使用 aria-label 标签属性。
aria-label
<button type="button" class="close" aria-label="Close"> <span aria-hidden="true">×</span> </button>