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
  • #202347


    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!


    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`.–net-16048

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