正如我在标题中所说,这个速记:
.settingsSelect {
background: url('../images/Custom.Select.Background.png'), url('../images/Settings.Input.Background.png') no-repeat, repeat 97%, 0;
background-size: 12px, contain;
}
显示为
并使用适当的手写方式:
.settingsSelect {
background-image: url('../images/Custom.Select.Background.png'), url('../images/Settings.Input.Background.png');
background-position: 97%, 0;
background-repeat: no-repeat, repeat;
background-size: 12px, contain;
}
一切都按预期进行。
问题出在哪里?谢谢。
最佳答案
速记版本中的语法不正确。应该是:
.settingsSelect {
background: url('../images/Custom.Select.Background.png') no-repeat 97%, url('../images/Settings.Input.Background.png') repeat 0;
}
可以这样想:
.selector {
background: background1, background2, background3, etc;
}
其中 background1
、background2
等都是 background
的简写:
url() repeat X%;
关于css - 速记 CSS 与普通 CSS 不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46456921/