我有多个块id如下:
<div id="block-11">content Here</div>
<div id="block-12">content Here</div>
<div id="block-13">content Here</div>
<div id="block-14">content Here</div>
<div id="block-15">content Here</div>
是否可以使用#block-[n]像这样给我的头发做造型?
参见MDN
[attr^=value]表示属性名为attr的元素,其值以value
作为前缀(在前面)
div[id^=block-] {
background: pink;
}
<div id="block-11">content Here</div>
<div id="block-12">content Here</div>
<div id="block-13">content Here</div>
<div id="block-14">content Here</div>
<div id="block-15">content Here</div>