2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
id: 5a90375238fddaf9a66b5d3b
|
2020-12-16 00:37:30 -07:00
|
|
|
title: 使用 align-self 垂直对齐项目
|
2018-10-10 18:03:03 -04:00
|
|
|
challengeType: 0
|
2020-02-11 21:39:15 +08:00
|
|
|
videoUrl: 'https://scrimba.com/p/pByETK/cmzd4fz'
|
|
|
|
forumTopicId: 301123
|
2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --description--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2021-01-08 11:20:48 -08:00
|
|
|
正如能设置网格项沿水平方向的对齐方式一样,我们也可以设置网格项沿竖直方向的对齐方式。为此,我们可以对网格项使用 `align-self` 属性来实现。在上一个挑战中适用于 `justify-self` 属性的属性值同样也可用于 `align-self`。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --instructions--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2021-01-08 11:20:48 -08:00
|
|
|
请使用值 `end` 来让 class 为 `item3` 的网格项沿底端对齐。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --hints--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2021-01-08 11:20:48 -08:00
|
|
|
class 为 `item3` 的元素应具有 `align-self` 属性且属性值应为 `end`。
|
2020-02-11 21:39:15 +08:00
|
|
|
|
2018-10-10 18:03:03 -04:00
|
|
|
```js
|
2020-12-16 00:37:30 -07:00
|
|
|
assert(code.match(/.item3\s*?{[\s\S]*align-self\s*?:\s*?end\s*?;[\s\S]*}/gi));
|
2018-10-10 18:03:03 -04:00
|
|
|
```
|
2020-02-11 21:39:15 +08:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --solutions--
|
|
|
|
|