gpt4 book ai didi

HTML5 枚举类型

转载 作者:可可西里 更新时间:2023-11-01 13:39:06 26 4
gpt4 key购买 nike

拜托,我不明白 standard 中的这些段落:

When the attribute is specified, if its value is an ASCII case-insensitive match for one of the given keywords then that keyword's state is the state that the attribute represents. If the attribute value matches none of the given keywords, but the attribute has an invalid value default, then the attribute represents that state. Otherwise, if the attribute value matches none of the keywords but there is a missing value default state defined, then that is the state represented by the attribute. Otherwise, there is no default, and invalid values must be ignored.

When the attribute is not specified, if there is a missing value default state defined, then that is the state represented by the (missing) attribute. Otherwise, the absence of the attribute means that there is no state represented.

关于invalid value defaultmissing value default 词。

谁能给我一个例子或更好地解释一下?

谢谢。

最佳答案

枚举属性可以定义为具有有效值列表:例如

  • 正文
  • 日期
  • 地址
  • 电话

还有两个默认值

  • 无效的默认值,例如电话
  • 缺失值默认值:例如正文

然后对于元素 foo 和属性 bar 如上所述:

<foo bar="date">   => valid value, state is `date`
<foo bar="time"> => invalid value, state is the invalid default `phone`
<foo> => missing value, state is the missing value default `text`

但是有时,属性没有为其定义无效的默认值,但它确实定义了缺失值默认值。在这种情况下:

<foo bar="date">   => valid value, state is `date`
<foo bar="time"> => invalid value, state is the missing value default `text`
<foo> => missing value, state is the missing value default `text`

有时,属性为其定义了一个无效的默认值,但它没有定义一个缺失值默认值。在这种情况下:

<foo bar="date">   => valid value, state is `date`
<foo bar="time"> => invalid value, state is the invalid default `phone`
<foo> => missing value, attribute has no state

有时属性没有为它定义的无效默认值或缺失值默认值。在这种情况下:

<foo bar="date">   => valid value, state is `date`
<foo bar="time"> => invalid value, attribute has no state
<foo> => missing value, attribute has no state

关于HTML5 枚举类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8269154/

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