Chrome提供invalid property value并且不尊重CSS:
grid-template-columns: repeat(auto-fill, minmax(auto, 1fr));
Run Code Online (Sandbox Code Playgroud)
auto用min-contentand 替换时也会失败max-content.
当auto被固定值替换时,它按预期工作,例如
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
Run Code Online (Sandbox Code Playgroud)
这是令人惊讶的,因为这两个repeat和minmax支持的关键字.
HTML很简单
<div class='wrapper>
<div>...</div>
<div>...</div>
</div>
Run Code Online (Sandbox Code Playgroud)
和css
.wrapper {
display: grid
grid-template-columns: repeat(auto-fill, minmax(auto, 1fr));
}
Run Code Online (Sandbox Code Playgroud)