How to adapt div's width to content with flexbox

后端 未结 4 1129
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-26 10:13

I want adapt the .flexrow div\'s width to content but i can\'t set it with flex.

HTML

4条回答
  •  孤城傲影
    2021-01-26 11:14

    UPDATE

    Try this one:

     .flexrow {
      width: 90%;
      display: inline-flex;  
      flex-direction: row;
      flex-wrap: wrap;
      -webkit-align-content: center;
      align-content: center;
      -webkit-justify-content: space-between;
      justify-content: space-between;  
      margin: 0 auto;  
    }
    .flexrow:after {  
        content: "";  
        width: 300px;
        margin: 10px;
        padding: 10px;
        text-align: center;    
    }
    

    Hope that what you're looking for :)

提交回复
热议问题