- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello all,
I was watching Episode #115 “Don’t Overthink it Grids” and around the 15 minute mark Chris uses a selector:
[class*=’col-‘]
He also uses this selector to adjust padding. This is not in the video but in the article
$pad
He uses this to taget everything that contains class col-. My question is what are these types of selector called? and more importantly where can I learn more about them? I’ve done some searches on the internet and can’t seem to find any articles related them.
Thanks a million for helping out an aspiring Front End Developer
Cheers
They are attribute selectors.
http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/
Thank you that is exactly what I was looking for! Thank you very much.
I tried using the [class*=’col-‘] selector in a gird framework but am having trouble getting it to work. Am I making a mistake in the code?
Yes. You used div[class*='.col-'] { ... }
instead of div[class*='col-']
.
Edit: I think it worth pointing out that attribute selectors can be pretty heavy even if they can be handy.
Thank you so much! That was driving me crazy, I didn’t notice I had the period in front of col.