18 lines
514 B
Markdown
18 lines
514 B
Markdown
|
---
|
|||
|
title: "Use display: flex to Position Two Boxes"
|
|||
|
localeTitle: “使用显示器
|
|||
|
---
|
|||
|
## 使用display:flex定位两个Box
|
|||
|
|
|||
|
[Flexbox](https://github.com/freecodecamp/guides/tree/master/src/pages/css/layout/flexbox/index.md)是一种在CSS3中构建内容的方法,允许您创建响应式网站。
|
|||
|
|
|||
|
这个挑战是在使用Flexbox时设置第一步。您需要通过添加_display:flex;_使父容器成为flex容器_。_到它的CSS部分。
|
|||
|
|
|||
|
例:
|
|||
|
|
|||
|
```CSS
|
|||
|
#main-container {
|
|||
|
display: flex;
|
|||
|
}
|
|||
|
|
|||
|
```
|