How can I select multiple IDs in CSS? For example:
#test_id_*{
}
<div id="test_id_10"></div>
<div id="test_id_11"></div>
Use an attribute selector
on the id attribute:
[id^='test_id_'] { color: red; }
Description:
[attr^=value]represents an element with an attribute name ofattrand whose first value is prefixed by "value".
To use one css for multiple id or class, you need to separate them with ,
#test_id_10,
#test_id_11
{
//some style
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With