Files
2018-10-16 21:32:40 +05:30

27 lines
840 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Create Flexible Layouts Using auto-fill
localeTitle: 使用自动填充创建灵活布局
---
## 使用自动填充创建灵活布局
此挑战将通过向_重复_功能添加**自动填充**值来阐述先前的挑战。这将导致div的数量根据视口的大小而不是先前指定的列值进行扩展。在下面的**Before**部分中,指定了**grid-template-column**值“3”。
_请记住以下代码段仅是示例而不是freeCodeCamp课程的确切挑战。_
### 之前
```css
grid-template-columns: repeat(3, minmax(50px, 2fr));
```
### 后
```css
grid-template-columns: repeat(auto-fill, minmax(50px, 2fr));
```
* * *
### 资源
您可以参考下一页的**语法**部分来查看**自动填充**值: [Mozilla开发者网络](https://developer.mozilla.org/en-US/docs/Web/CSS/repeat)