Why auto-fit or auto-fill not working properly with minmax?

后端 未结 4 630
臣服心动
臣服心动 2021-02-10 16:17

It doesn\'t work properly when I add auto-fit or auto-fill instead of a number.

 grid-template-columns: repeat(auto-fit, minmax(max-content, max-content));
         


        
4条回答
  •  無奈伤痛
    2021-02-10 17:00

    Do repeat(auto-fit, minmax(min-content, 0))

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    ul {
     display: grid;
     width:50px;
     grid-template-columns: repeat(auto-fit, minmax(min-content, 0));
     grid-gap: 10px;
    }
    
    li {
      list-style: none;
    }
    
        
      

提交回复
热议问题