#Full-bleed layout with modern #CSS
Use modern CSS and a few lines of code to create a full-bleed layout.
Full-bleed? It’s when an element needs to bleed outside the main container and extend to the edge of the page.
html {
container-type: inline-size;
}
main {
--w: 600px; /* the max-width */
--m: 1em; /* margin on small screen */
margin-inline: max( var(--m),(100cqw - var(--w))/2);
}
.full-bleed {
margin-inline: min(-1*var(--m),(var(--w) - 100cqw)/2);
}