Skip to content

Instantly share code, notes, and snippets.

@probaldhar
Last active August 29, 2015 14:25
Show Gist options
  • Save probaldhar/249e4f505a6266b9399a to your computer and use it in GitHub Desktop.
Save probaldhar/249e4f505a6266b9399a to your computer and use it in GitHub Desktop.
CSS3 Attribute Selectors: Substring Matching
It's an attribute wildcard selector. In the sample you've given, it looks for any child element under .show-grid that has a class that CONTAINS span.
So would select the <strong> element in this example:
<div class="show-grid">
<strong class="span6">Blah blah</strong>
</div>
You can also do searches for 'begins with...'
div[class^="something"] { }
which would work on something like this:-
<div class="something-else-class"></div>
and 'ends with...'
div[class$="something"] { }
which would work on
<div class="you-are-something"></div>
Referance : http://www.impressivewebs.com/css3-attribute-selectors-substring-matching/
http://stackoverflow.com/questions/9836151/what-is-this-css-selector-class-span
http://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize--net-16048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment