18 lines
429 B
Markdown
18 lines
429 B
Markdown
|
---
|
|||
|
title: Use the flex Shorthand Property
|
|||
|
localeTitle: 使用flex速记属性
|
|||
|
---
|
|||
|
## 使用flex速记属性
|
|||
|
|
|||
|
您可以单独设置`flex-grow` , `flex-shrink`和`flex-basis`属性。如果您需要查看所有这些值的值,可以使用以下格式在一行中执行`flex: flex-grow flex-shrink flex-basis;` 。
|
|||
|
|
|||
|
例:
|
|||
|
|
|||
|
```css
|
|||
|
#box-1 {
|
|||
|
background-color: dodgerblue;
|
|||
|
flex: 2 2 150px;
|
|||
|
height: 200px;
|
|||
|
}
|
|||
|
|
|||
|
```
|