How many CSS selectors can be included?
P粉002572690
2023-08-16 11:30:40
<p>I've tried looking for an answer to this problem, but to no avail: </p>
<p>I am using css selector to locate all class names starting with col-1, col-2, col-3, col-[class*="col-"]. But I'm running into conflicts with some other third-party integration class names: <code>col-md-11</code>, <code>col-lg-2</code>, <code>col-sm- 3</code>... Thanks a lot, does anyone have any ideas to select only the class names: col-1, col-2, col-3, col-... The most concise way (maybe just one line of code ). </p>
<p>My HTML example: </p>
<pre class="brush:php;toolbar:false;"><div class="row row_1">
<div class="col-4"></div>
<div class="col-10"></div>
<div class="col-3"></div>
<div class="col-md-11"></div>
</div>
<div class="row row_2">
<div class="col-12"></div>
<div class="col-lg-2"></div>
<div class="col-8"></div>
<div class="col-sm-3"></div>
</div></pre>
<p>I tried searching on the internet but couldn't find a solution. </p>
It's a bit complicated, but you can combine your existing content with a :not selector;