首页 \ 问答 \ 替代HTML5中的标签?(Alternative to tag in HTML5?)

替代HTML5中的标签?(Alternative to tag in HTML5?)

我今天正在阅读有关Shadow DOM的内容,作者使用此<content>标记从主机中提取textContent

教程http//www.html5rocks.com/en/tutorials/webcomponents/shadowdom/

当我查找它时,我发现<content>标记已被弃用,应该避免使用。 我现在应该怎么做? 我应该学会使用<content>标签吗? 来源Mozilla文档


I was reading today about Shadow DOM, where the author used this <content> tag to pull in textContent from the host.

Tutorial: http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom/

When I looked it up, I found that the <content> tag has been deprecated and should be avoided. What should I do now? Should I learn to use <content> tag or not? Source: Mozilla Documentation

更新时间:2022-01-23 14:01

最满意答案

相同的文档( Mozilla FireFox )声明:

它现在已被<slot>元素取代。

使用<slot>元素。 当某些东西被弃用时,你不应该再使用它了。 ( Mozilla也说明了这一点。)弃用意味着它不再被批准/不批准。


The same documentation (Mozilla FireFox) states:

It has now been replaced by the <slot> element.

Use the <slot> element. When something is deprecated, you should no longer use it. (Mozilla also states this.) Deprecated means it is no longer approved of/disapproved.

相关问答

更多