tech/webdev magazine

July 31, 2016

Full Width Containers in Limited Width Parents

Sunday, July 31, 2016 Teklinks

The issue is: how do we make a full-browser-width container when we're inside a limited-width parent? We want to stretch it exactly as wide as the browser window. If we could use absolute positioning, we could set the container to be at left: 0; and width: 100%; - but we can't, because we want the container to remain in flow. Can't we just apply some negative margin to each side and pull it outwards? In some circumstances, we can!

Full article