相关疑难解决方法(0)

HTML5中style元素的"scoped"属性的当前状态是什么?

它在这里说http://www.w3.org/TR/html-markup/style.html#style:

允许的父元素

任何可以包含元数据元素,div,noscript,section,article的元素

<style>或多或少让每一个地方(如果<div>是允许的),但是,在另一方面,我发现了一个更详细的信息在这里http://www.w3.org/TR/2012/WD-html5-20121025/the-style -element.html#ATTR式作用域

可以使用此元素的上下文:(注释:样式)

If the scoped attribute is absent: where metadata content is expected.
If the scoped attribute is absent: in a noscript element that is a child of a head element.
If the scoped attribute is present: where flow content is expected, but before any other flow content other than inter-element whitespace, and not as the child of an element whose content model is transparent.
Run Code Online (Sandbox Code Playgroud)

以及本文档的后面部分:

scoped属性是布尔属性.如果存在,则表示样式仅适用于以style元素的父元素为根的子树,而不是整个Document.

如果存在scoped属性且元素具有父元素,则style元素必须是其元素之外的元素的第一个节点,而不是元素间空格,并且父元素的内容模型必须不具有透明组件.

这读起来就像(或将会)"两个不同的 …

html css html5 attributes

25
推荐指数
4
解决办法
1万
查看次数

标签 统计

attributes ×1

css ×1

html ×1

html5 ×1