Align an element to bottom with flexbox

前端 未结 8 1986
陌清茗
陌清茗 2020-11-22 15:34

I have a div with some children:

heading 1

heading 2

Some

8条回答
  •  萌比男神i
    2020-11-22 16:30

    Not sure about flexbox but you can do using the position property.

    set parent div position: relative and child element which might be an

    or

    etc.. set position: absolute and bottom: 0.

    Example:

    index.html

    Child

    style.css

    .parent {
      background: gray;
      width: 10%;
      height: 100px;    
      position: relative;
    }
    p {
      position: absolute;
      bottom: 0;
    }
    

    Code pen here.

提交回复
热议问题