Is it possible to force a behavior and ignore css in child DIVs ?
I want to remove all margins that are childs of a top DIV... but only this DIV childs
Btw I need this because I cannot get to the rea开发者_开发百科l CSS i need to inject something that cancels the behaviour (margins) i wanna erase.
<DIV>
<DIV class="no_margin">
<DIV class="has_margin"> </DIV> // this one has a margin, and should lose it
</DIV>
</DIV>
<DIV class="has_margin"> </DIV> // should not lose margin
You could do any of these:
.no_margin .has_margin { margin: 0 }
.no_margin div { margin: 0 }
.no_margin * { margin: 0 }
And you could add !important
if the priority isn't high enough, like margin: 0 !important
.
Example http://jsfiddle.net/9yx6B/
use !important
.no_margin *{
margin:0!important;
}
精彩评论