stylus設置兄弟元素樣式:
鼠標浮動在 .video-li 元素上時,.video-li 兄弟中 .video-info 下的 .word 顯示。css
.video-li
&:hover
~ .video-info
.word
visibility visible
設置 h1 兄弟元素中,class 爲 p1 的元素樣式:html
<!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>