I have a div followed by another div
<div class="myclass">
<div>Some Data</div>
</div>
and the class content like
.myclass div {
background-color: #fff;
border: 1px solid #000;
padding: 4px 16px;
}
Here background-color is not only applied to inner div but also to the outer div.
Shouldn’t it apply to the inner div only?
Are there any other possible ways?
I am not able to specify class to inner div as it is dynamically generated by other api..
Thanks in advance..
Apply the
paddingto the outerdiv:http://jsfiddle.net/xCedS/
Original answer that ended up working for the OP: https://stackoverflow.com/revisions/6520122/1