set fixed spacing for flexbox list

后端 未结 5 1092
迷失自我
迷失自我 2021-01-25 06:38

i noticed that on my firefox the distance between the bottom of the website and the list for links(terms,about...) is really large, i cannot seem to figure out what to specify i

5条回答
  •  长发绾君心
    2021-01-25 06:53

    i noticed that on my firefox the distance between the bottom of the website and the list for links(terms,about...) is really large

    This is the nature of the webpage you have created because the content only goes as far as that height. In order for your footer element to stay at the bottom: I recommend utilizing Flexbox & setting margin-top: auto to your footer. In order for the margin to kick in, simply give your container (in this case, .body) the flex display property & a minimum height of 100vh (so that it takes at least 100% of the viewport in terms of height) and assign column as it's flex-direction. This way, the footer can always stay at the bottom on your given layout.

    body {
        display: flex;
        flex-flow: column;
        min-height: 100vh;
    }
    
    footer.cl {
        margin-top: auto;
    }
    

提交回复
热议问题