gpt4 book ai didi

html - 如果属性从内部样式表和内联样式接收值,该值是否收到 'specified value' ?

转载 作者:行者123 更新时间:2023-12-03 19:04:58 25 4
gpt4 key购买 nike

page状态:

The specified value of a CSS property is the value it receives from the document's style sheet.


什么算作文档的样式表?
我的直觉说:
外部样式表(来自用户、作者和用户代理)计数。
我不确定内部样式表( style 标签)和内部样式( style 属性)是否计算在内。

最佳答案

为了更好地理解,请参阅 the specification你可以在这里阅读:

  1. If the cascade results in a value, use it. Except that, if the value is 'inherit', the specified value is defined in “The 'inherit' value” below.

级联比文档的样式表更明确。
如果您继续阅读规范,您会发现:

Author. The author specifies style sheets for a source document according to the conventions of the document language. For instance, in HTML, style sheets may be included in the document or linked externally.ref


所以很明显,所有的 CSS 都被认为是内部样式和内联样式,这是合乎逻辑的。
您可以看到以下规则:
  • 如果将 CSS 应用于元素,我们将使用它
  • 如果没有应用任何内容,我们将查看该属性是否被继承。如果是,我们使用来自父级的值。如果没有,我们使用初始值。
  • 关于html - 如果属性从内部样式表和内联样式接收值,该值是否收到 'specified value' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63856038/

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