很明显,主要的浏览器默认使用该
max函数中的
minmax()值。
规范定义尚不清楚这是怎么回事-
min还是
max默认?–应处理:
minmax()
定义一个大于或等于 min 且小于或等于 max 的大小范围。
如果 max <min,则将 max 忽略并将
minmax(min,max)其视为 min 。
最大值是
<flex>设置轨道的弹性系数的值;至少无效。
我可能还没有在轨道大小调整算法中发现这种行为。
这是解决该问题的另一种方法:
- 将行高度设置为
auto
(基于内容的高度) - 管理网格项目的最小和最大高度
body { background: gray; border: solid black 1px; display: grid; grid-template-columns: 1fr 2fr 1fr; grid-template-rows: auto; } aside { border-right: solid 1px red; } aside.homepage { background: blue; min-height: 50px; max-height: 150px; } <aside>aside</aside> <aside > <header>header</header> <main>main</main> <footer>footer</footer> </aside> <aside>aside</aside>


