urftna
Last Updated: February 25, 2016
·
823
· steveniseki
Stevenm

css plus and greater than

css

<b> The > sign is used for selecting the immediate child of an element </b>

In this example the 2 inner divs would be selected

css

.container > inner-2 {
}

html

<div class="container">
  <div class="inner-1"></div>
  <div class="inner-2"></div>
</div>

<b>The + sign is used for selecting an adjacent sibling element</b>

In this example the p with class second is selected

css

.first + .second { 
}

html

<div>
<p class="first"></p>
<p class="second"></p>
</div>
Say Thanks
Respond

1 Response
Add your response

12797
Ecf73f840bae7ba4351761c66ecde543

Wow thanks for this post

over 1 year ago ·