I saw this selector in Twitter Bootstrap:
.show-grid [class*="span"] {
background-color: #eee;
text-align: center;
border-radius: 3px;
min-height: 30px;
line-height: 30px;
}
Does anyone know what this technique is called and what it does?
It’s an attribute wildcard selector. In the sample you’ve given, it looks for any child element under
.show-gridthat has a class that CONTAINSspan.So would select the
<strong>element in this example:You can also do searches for ‘begins with…’
which would work on something like this:-
and ‘ends with…’
which would work on
Good references