How to align content of a div to the bottom

后端 未结 26 2851
挽巷
挽巷 2020-11-22 01:13

Say I have the following CSS and HTML code:

26条回答
  •  野的像风
    2020-11-22 01:59

    Here's the flexy way to do it. Of course, it's not supported by IE8, as the user needed 7 years ago. Depending on what you need to support, some of these can be done away with.

    Still, it would be nice if there was a way to do this without an outer container, just have the text align itself within it's own self.

    #header {
        -webkit-box-align: end;
        -webkit-align-items: flex-end;
        -ms-flex-align: end;
        align-items: flex-end;
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        height: 150px;
    }
    

提交回复
热议问题