How to adapt div's width to content with flexbox

后端 未结 4 1134
佛祖请我去吃肉
佛祖请我去吃肉 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条回答
  •  猫巷女王i
    2021-01-26 10:57

    Try this code-example

    .flexrow .card {
      height: 60px;
      background-color: red;
      margin: 10px;
      padding: 10px;
      text-align: center;
    }
    

    I removed the width, so that flexrow can adapt to the content. Is this what you wanted? If not please specify (maybe a picture?)

提交回复
热议问题