Break a Child out of Parent Container

Posted on Feb 26, 2026

by Jimmy

CSS

A CSS snippet to break a child out of its parent container.

CSS
        
            .parent {
    max-width: 720px;
    margin: 0 auto;
}

.child {
    max-width: 1100px; // Optional: Specify a max width, otherwise it will take 100% of the available space.
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}        
    

Back to Snippets