Get a free trial // Grow your CSS skills // Land your dream job

Advanced CSS Selector

  • # February 10, 2013 at 2:55 pm

    Hello all,
    I was watching Episode #115 “Don’t Overthink it Grids” and around the 15 minute mark Chris uses a selector:


    He also uses this selector to adjust padding. This is not in the video but in the article


    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


    # February 10, 2013 at 3:54 pm

    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?

    # February 10, 2013 at 5:00 pm

    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.

    # February 10, 2013 at 5:13 pm

    Thank you so much! That was driving me crazy, I didn’t notice I had the period in front of col.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed