I'm not sure why. In CSS, strings can be quoted or unquoted. As you can see in this interesting article about quotes in strings in CSS:因此,CSS中有效的未加引号的属性值是不是空字符串的任何文本字符串,由转义字符和/或完全匹配/[-_ \ u00A0- \ u10FFFF]/的字符组成,并且不以一个或两个连字符或一个连字符后跟一个数字开头. So, a valid unquoted attribute value in CSS is any string of text that is not the empty string, consists of escaped characters and/or characters matching /[-_\u00A0-\u10FFFF]/ entirely, and doesn’t start with a digit or two hyphens or a hyphen followed by a digit.因此,您使用的值是没有引号的正确字符串.So values you are using are correct strings without quotes. SASS也接受带引号和不带引号的两种字符串. [data-type = myPic1] 和 [data-type ="myPic2"] 都将正确编译.但是由于某种原因,如果您使用插值,则必须对其进行引用.SASS accepts as well both types of strings, quoted and unquoted. [data-type=myPic1] and [data-type="myPic2"] would be both correctly compiled. But for some reason if you use an interpolation you must quote it. 这篇关于Sass插值问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-02 03:23