• stylus设置兄弟元素样式:
    鼠标浮动在 .video-li 元素上时,.video-li 兄弟中 .video-info 下的 .word 显示。
           .video-li
                &:hover
                    ~ .video-info
                        .word
                            visibility visible
  • 设置 h1 兄弟元素中,class 为 p1 的元素样式:
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
h1 ~ .p1 {margin-top:50px;}
</style>
</head>

<body>
<h1>This is a heading.</h1>
<p>This is paragraph.</p>
<p>This is paragraph.</p>
<p>This is paragraph.</p>
<p>This is paragraph.</p>
<p class="p1">This is paragraph.</p>
</body>
</html>

相关文章:

  • 2021-12-28
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-10-03
  • 2021-09-04
猜你喜欢
  • 2021-07-10
  • 2022-12-23
  • 2022-02-08
  • 2021-09-13
  • 2021-08-28
相关资源
相似解决方案