与视频讲解有区别?

来源:2-15 选择练习

所向无一

2019-04-06 23:28:48

请问下这道题,视频中讲解并且给出的总结是 :属性值为“value”或者以“value-” 开头的元素;到了题目就变成了:属性值为以“value-” 开头的元素到底哪个是正确的啊?http://img.mukewang.com/climg/5ca8c57a0001e16a05000282.jpg

写回答

2回答

慕瓜6171612

2019-06-22

Definition and Usage

The [attribute|=value] selector is used to select elements with the specified attribute starting with the specified value.

Note: The value has to be a whole word, either alone, like, or followed by a hyphen( - ), like.


以上是是W3C官方解释,来源:https://www.w3schools.com/cssref/sel_attribute_value_lang.asp


解释说明,value必须是一个whole word,也就是说必须是一个完整的单词。而不是substring。

1

樱桃小胖子

2019-04-07

课程中老师讲解的是正确的,老师想要表达的意思是[attribute|=value] 属性值中必须是完整且唯一的单词,或者以-分隔开才能匹配到,如:

http://img.mukewang.com/climg/5ca9b9b10001d71f06010551.jpg

希望可以帮到你!

1

0 学习 · 40143 问题

查看课程