I have a section on my website that is restricted to a specific width like this:
HTML
<div class="section">
// content goes here
</div>
CSS
.section {
max-width: 1300px;
}
Now, I have another div that I want to expand beyond the maximum width and reach the edges of the screen. However, I don't want it to be positioned absolutely and disrupt the flow of the website. Here's what I've tried:
HTML
<div class="expand-beyond">
// content for expansion
</div>
CSS
.expand-beyond {
width: 100vw;
height: 200px;
}
While this gives me the desired width, it still adheres to the maximum width set by the parent container and doesn't start from the left edge of the window. Adding a negative margin could solve this issue, but since the window size varies, the negative margin won't always be accurate. How can I overcome this challenge without resorting to absolute positioning?
Thanks