Issue
I would like to have a div ignore the margin of its parent div as in such a case:
html:
<div class="wrap">
I'm annoying!
<div class="myown"> I don't want to have that annoying guy's margin! </div>
</div>
css:
.wrap {width: 200px; margin: 0 auto;} /* Do not change */
.myown{margin: 0;}
I found this answer but it still doesn't work!
Here it is when ran: http://jsfiddle.net/KYbq3/2/
Under my circumstances I cannot change .wrap but only .myown.
Solution
If you want it to "break out" of the container, then your only option seems to be position: absolute;. The problem with it is that it takes the element out of the natural flow.
.myown{
position: absolute;
left: 0;
width: 100%;
}
Answered By - kapa
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.