Important Notice:

Course Content
Float Property
0/1
Z-Index
0/1
CSS object-fit Property
0/1
CSS Visibility Property
0/1
CSS (Chapter 4) M2-R5.1
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>

 

error: Content is protected !!