What does the “~” (tilde/squiggle/twiddle) CSS selector mean?

后端 未结 5 1283
孤街浪徒
孤街浪徒 2020-11-21 05:13

Searching for the ~ character isn\'t easy. I was looking over some CSS and found this

.check:checked ~ .content {
}

What does

5条回答
  •  借酒劲吻你
    2020-11-21 05:54

    Note that in an attribute selector (e.g., [attr~=value]), the tilde

    Represents an element with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly value.

    https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

提交回复
热议问题