I have
<div style="position:relative; width:500px;">
<div style="position:absolute; width:100%"></div>
</div>
The child div takes 100% width of it’s parent div. Is there a way i can force it to take 100% width of body and not the parent div. Both relative and absolute positioning are required as i have it in the code above.
The only way to do this while keeping the relative and absolute positioning as you have in your code is to use JavaScript. You need to get window width and set that as the div width. You also need to detect window size on resize so you always have your div adjust set to the current window width.
The other 2 ways you can do this may not be options for but worth mentioning