Button at the center and bottom of div

后端 未结 9 1334
醉酒成梦
醉酒成梦 2021-02-06 11:35

How to make a button be at the bottom of div and at the center of it at the same time?

9条回答
  •  难免孤独
    2021-02-06 12:14

    I know this has been answered a long time ago, but I couldn't use display:table on the parent container so I had to find another way around.

    It turned out that this worked just fine:

    .container{
        position:absolute;
    }
    .button{
        position:absolute;
        bottom: 5px;
        left: 0%;
        right: 0%;
        text-align: center;
    }
    

    Edit: This works if your button is a

    , not for an actual
提交回复
热议问题