About Lesson
General Sibling Selector
General sibling selector ऐसे सभी elements को select करता है जो specify किए गये element के siblings है यानि की उसका parent same हो। यहा दोनों elements के बीच मे “~” symbol का use होता है।
General Sibling Selector
General sibling selector selects all such elements which are siblings of the specified element i.e. it has the same parent. Here “~” symbol is used between the two elements.
Example:
<html> <head> <style> p ~ span { background-color:yellow; } </style> </head> <body> <div> <p>This is a paragraph</p> <span>This span is adjacent sibling of above paragraph</span> <span>This span is sibling of above paragraph</span> <span>This span is also sibling of above paragraph</span> </div> </body> </html> |