css plus and greater than
<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>
Written by Steven Iseki
Related protips
1 Response
Wow thanks for this post
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Related Tags
#css
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#