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

13 lines
843 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: Align Elements Using the justify-content Property
localeTitle: 使用justify-content属性对齐元素
---
## 使用justify-content属性对齐元素
正如挑战所述,要通过它,您需要将`justify-content`设置为中心。然而,挑战的关键在于体验并了解不同选项如何影响内容。
`center` :确保您的子元素在父容器中居中。
`flex-start` :将所有内容推向左侧。
`flex-end` :将一切推向正确的方向。
`space-between` :将第一个和最后一个元素分别向左和向右推,并在它们之间添加偶数空格。如果您有奇数个元素,它会将它们添加到中心并根据顺序继续左右推动。
`space-around` 类似于space-between但是元素周围会有相等的间距所以第一个和最后一个不会直接在边缘上。