侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

(〜)是什么意思在CSS

2022-08-19 星期五 / 0 评论 / 0 点赞 / 105 阅读 / 1290 字

参见英文答案 > What does the “~” (tilde/squiggle/twiddle) CSS selector mean?4个答案我想知道什么(〜)意思在css。 #im

...参见英文答案 > What does the “~” (tilde/squiggle/twiddle) CSS selector mean?4个答案我想知道什么(〜)意思在css。

#img1:hover ~ #img2 {    opacity: 0;}

在visual studio中,我得到“意想不到的字符序列”的错误,当我使用这个符号。这在CSS中的实际意义是什么。它有什么作用?

.

解决方法

. http://www.w3.org/TR/selectors/ .

8.3.2. General sibling combinator

The general sibling combinator is made of the “tilde” (U+007E,~)
character that separates two sequences of simple selectors. The
elements represented by the two sequences share the same parent in the
document tree and the element represented by the first sequence
precedes (not necessarily immediately) the element represented by the
second one.

.

h1 ~ pre

匹配< pre>这里:

<h1>Definition of the function a</h1><p>Function a(x) has to be applied to all figures in the table.</p><pre>function a(x) = 12x/13.5</pre>

还存在用于相邻兄弟组合器的选择器:具有h1 pre< pre>标签必须在< h1>

. ..

广告 广告

评论区