Align an element to bottom with flexbox

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

I have a div with some children:

heading 1

heading 2

Some

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 16:29

    Try This

    .content {
          display: flex;
          flex-direction: column;
          height: 250px;
          width: 200px;
          border: solid;
          word-wrap: break-word;
        }
    
       .content h1 , .content h2 {
         margin-bottom: 0px;
        }
    
       .content p {
         flex: 1;
        }
       

    heading 1

    heading 2

    Some more or less text

    Click me

提交回复
热议问题