Sticky footer in Angular 2 Material

后端 未结 3 1684
我在风中等你
我在风中等你 2021-02-09 00:00

I have been searching and searching for about 3 hours now because I didn\'t want to have to ask, but how can I keep a \'footer\' variable at the bottom but not like fixed at the

3条回答
  •  情歌与酒
    2021-02-09 00:41

    Here is a solution in few lines:

    app.component.html:

    // your header
    // your content
    // your footer

    styles.css:

    html, body {
        height: 100%;
        box-sizing: border-box;
        margin: 0;
    }
    

    Another alternative if you prefer to fill the footer instead of your content:

    app.component.html:

    // your header // your content // your footer

    styles.css:

    html, body {
        height: 100%;
    }
    

提交回复
热议问题