【发布时间】:2017-07-12 05:52:06
【问题描述】:
我想为所有 id 不包含 month 的 select2 框编写 CSS,我完成了流程。
span[id *= "month"]{
background-color: red !important;
}
这适用于包含字母。
但以下应该不适用,但它也适用于所有 id 包含 month 的人。
span:not([id *= "month"]){
background-color: red !important;
}
注意:为什么我使用span标签,因为select会生成带有如下选择标签ID的span标签:
<span title="Month" id="select2-ga_regsmonth-container" class="select2-selection__rendered">Month</span>
我做错了什么? 欣赏
【问题讨论】:
标签: css jquery-select2