I'm trying to achieve a scenario in my project wherein I have a parent div which has a margin of some pixels from left and right and then I have a child div inside it. I want the child div to take 100% of the width of the screen.
P.S.: The position of the parent is relative.
I do not want to use negative margins on child div.
Child divs are inside shadowRoot whereas parent div is outside it
I cannot apply position: fixed to child as it will fix it WRT window and I do not want that.
Here is the sample code:
.full-width {
position: absolute;
width: 100%;
left: 0;
border: 10px red solid
}
.container {
position: relative;
max-width: 1440px;
border: 10px black solid;
height:50vh
<div class="container">
<div class="full-width"></div>
</div>