I was looking at the Twitter Bootstrap 2 CSS file and saw [class*="span"]
. What does it do, and what is the name of that method?
Asked
Active
Viewed 202 times
0

BoltClock
- 700,868
- 160
- 1,392
- 1,356

Matthew Verstraete
- 6,335
- 22
- 67
- 123
-
Odd, I search but that did not come up. – Matthew Verstraete Feb 22 '14 at 02:58
-
Symbols are a little difficult to search for, so it's understandable. – BoltClock Feb 22 '14 at 02:58
3 Answers
2
That's the CSS attribute selector. It selects elements containing span
in their class
attribute.
For e.g.
<div class="myclass span-12"></div>
You could select the above element by
[class*="span"]

Hashem Qolami
- 97,268
- 26
- 150
- 164
0
CSS Attribute Selector
That is a CSS attribute selector, which follows the syntax [attribute*="value"]
where
"attribute" is an HTML element attribute (i.e. class
) and "value" is contained somewhere within the attribute string.
Your example is a CSS selector that will match any HTML element where the string "span" is contained within the element's class name string.
For more information on CSS attribute selectors, see the following article from CSS-Tricks: http://css-tricks.com/attribute-selectors/

Kyle
- 2,822
- 2
- 19
- 24