How to adopt a flex div's width to content in HTML?

JavascriptWeb DevelopmentFront End Scripts

Use display: inline-flex to adopt a flex div’s width to content:

#box {
   display: inline-flex;
   flex-direction: row;
   flex-wrap: wrap;
   max-width: 200px;
   padding: 10px;
   margin: 20px;
   background-color: blue;
}
raja
Published on 11-Apr-2018 06:58:03
Advertisements