gpt4 book ai didi

HTML 语言切换器可访问性

转载 作者:行者123 更新时间:2023-12-04 15:50:05 24 4
gpt4 key购买 nike

是否有任何咏叹调或角色要添加到语言切换链接中?
例如,我在页脚中放置了两个链接来更改当前语言。

<a href="/language/switch/fr">Fr</a>
<a href="/language/switch/uk">Uk</a>

我有任何语义标签要添加到这个链接吗?

最佳答案

例子:

<a href="/language/switch/fr" lang="fr" hreflang="fr">Fr</a>
https://www.nomensa.com/blog/2010/7-tips-for-multi-lingual-website-accessibility了解更多信息。
lang attribute doc :

The lang global attribute helps define the language of an element: thelanguage that non-editable elements are written in, or the languagethat the editable elements should be written in by the user.


hreflang attribute doc :

Hints at the human language of the linked URL. No built-in functionality. Allowed values are the same as the global lang attribute.

关于HTML 语言切换器可访问性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54196909/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com