csspoo

Search

Tags

  • Animation 1
  • Hover 2

Feed

RSS2.0
  • 2019-11-20

    Contains or has selector

    Author

    Jens Törnell

    Comments

    Start a discussion

    No selector is called contains selector or has selector but you can use * for the same effect.

    CSS

    div[class*="test"] {
      background: #ddd;
    }

    HTML

    <div class="a-test-class">Test class</div>
    <div class="another-class">Another class</div>

    Playground Full page

    Sources

    • https://www.w3schools.com/cssref/sel_attr_contain.asp

    If you like this post, please share it! Tweet this!

  • Write for us
  • Contact us
  • About
  • License
Copyright © 2019

This page uses cookies for Google Analytics.