Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS what does ~ mean in css?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #202347
    pallavi1811
    Participant

    Hi

    I saw some one using ~ in css. but not able to find out what it means?

    Can some one please expalin or give me some referral links.

    Thanks in advance!

    #202348
    Paulie_D
    Member

    It’s a general sibling selector

    ul ~ p {
       color: red;
    }
    

    This sibling combinator is similar to X + Y, however, it’s less strict. While an adjacent selector (`ul + p`) will only select the first element that is immediately preceded by the former selector, this one is more generalized. It will select, referring to our example above, any `p` elements, as long as they follow a `ul`.

    http://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize–net-16048

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.