Search code examples
cssangulartypescriptangular-materialangular-cdk

Angular material container not expanding to fill page?


I'm trying to follow this tutorial in creating a slide in navigation, and I have the following stackblitz. The side nav is toggleing, but it is not expanding to fit the page. IIUC this CSS class is supposed to do the trick (In styles.css):

.container {
    position: absolute;
    top:0px;
    left:0px;
    bottom:0px;
    right: 0px;
}

Thoughts?


Solution

  • .container {
        position: absolute;
        height: 100vh;
        width: 100vw;
        top:0px;
        left:0px;
        bottom:0px;
        right: 0px;
    }
    

    let me know if that helps, it looks like it works but i don't know exactly what you want, and optionally

    padding: 0;
    margin: 0;
    

    on the body element to remove the scroll bar.