主頁
CSS
CSS 組合器
試一試:通用同級選擇器
執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> div ~ p { background-color: yellow; } </style> </head> <body> <h2>General Sibling Selector</h2> <p>The general sibling selector (~) selects all elements that are next siblings of a specified element.</p> <p>Paragraph 1.</p> <div> <p>Paragraph 2.</p> </div> <p>Paragraph 3.</p> <code>Some code.</code> <p>Paragraph 4.</p> </body> </html>