Metadata Indexing via Attributes
Search engines like Google and Baidu crawl HTML attributes. By using data-tip
to store secondary information, you provide robots with additional keyword context
associated directly with your anchor text. This CSS-first approach
leverages the attr() function, keeping the DOM light while ensuring
contextual data is physically present in the source code.
谷歌和百度等搜索引擎会抓取 HTML 属性。通过使用 data-tip 存储辅助信息,您为机器人提供了与锚文本直接关联的额外关键词上下文。这种CSS 优先方案利用了 attr() 函数,在保持 DOM 轻量化的同时,确保上下文数据物理存在于源代码中。