HTML:
<div id="wrapper">
<div class="body">
text text text
</div>
<div class="comment_submit">
<!-- here goes username text field !-->
<div class="body">
<textarea></textarea>
</div>
<!-- here goes submit button !-->
</div>
</div>
CSS:
#wrapper{
float:left;
width:100%;
}
#wrapper .body{
border:1px solid red;
background:#f5f5f5;
padding:5px;
}
.comment_submit .body{
border:2px solid red;
background:#cccccc;
}
为什么位于comment_submit div内部的body div会获得#wrapper .body样式,而不仅仅是.comment_submit .body样式?
我知道#wrapper .body样式包括所有位于#wrapper内部的.body div,但我该如何停止这种情况发生?