I have two divs with the same class, .body
, but one is nested inside another div with the class .box. Here's an example:
<div class="box">
<div class="body">
</div>
</div>
<div class="body">
</div>
I'm trying to style only the .body that is inside .box, but my current CSS isn't working and it's affecting both .body elements.
.box .body {
background-color: red;
}
I don't want to change .box to #box because "box" might appear more than once in the same document.
Please check out the issue here: http://jsfiddle.net/H2cmE/