How to use wildcard CSS selectors with LESS

If you are using LESS and need to use a wildcard CSS selector to target all elements with a class name starting with col-md, the syntax is

[class^="col-md"] { ...}

 less wildcard css selectors

Here's a full working example



.gallery {
     [class^="col-md"] {

This will select all the elements with classes .col-md-1 through .col-md-12 that are also children of .gallery


Pas de connexion Internet