I am working on a the html/css of the landing page of a website/application and I don't want to make too many changes. The templates are rendered using Jinja2 and the homepage extends from a page_template.html. There are many page templates that extend the page_template.html so I would like to fiddle as little as possible with it. The designer would like to have the background-color of a div (or two) on the homepage extend out over the entire width of the browser no matter the browser/screen resolution. The page template has a page-container
id wrapping around the entire content like so.
#page-container {
background-position: 0 85px;
max-width: 1200px;
position: relative;
margin: 0 auto;
}
If I want to extend a div to go outside this width of 1200px I decided to try something like this:
.overflow {
background-color: #fff;
margin-right: -200px;
margin-left: -200px;
padding-right: 200px;
padding-left: 200px;
}
And do something like this:
<div id="page-container">
<div class="overflow">
Content
</div>
</div>
And it seems to work. And it works well enough for this webapp ( I think ). However it breaks the responsiveness of the page in that the divs which have this .overflow
class do not resize when the browser is made smaller. Is their a better way to do this? And is their a way to do this without affecting the responsiveness?