You could use [class*="col-"]
CSS attribute selector to select any element contains at least one occurrence of col-
as its class
value.
[class*="col-"] {
border-color: red;
}
If all values of class
attributes begin with col-
, you could use [class^="col-"]
selector.
However, in order to prevent for classes like foo-col-1
to be selected, you could use a combination of two above selectors as follows (Thanks to @JosephSpens):
[class^="col-"], [class*=" col-"] {
border-color: red;
}
WORKING DEMO.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…