2018-10-10 22:03:03 +00:00
|
|
|
---
|
|
|
|
id: 587d781d367417b2b2512ac5
|
2020-12-16 07:37:30 +00:00
|
|
|
title: 设置段落的 line-height
|
2018-10-10 22:03:03 +00:00
|
|
|
challengeType: 0
|
2020-02-11 07:46:34 +00:00
|
|
|
videoUrl: 'https://scrimba.com/c/crVWdcv'
|
|
|
|
forumTopicId: 301070
|
2018-10-10 22:03:03 +00:00
|
|
|
---
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --description--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
2021-01-08 19:20:48 +00:00
|
|
|
CSS 提供 `line-height` 属性来设置行间的距离。行高,顾名思义,可以用来设置每行文字所占据的垂直空间。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --instructions--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
给 `p` 标签添加 `line-height` 属性并赋值 25px。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --hints--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
2021-01-08 19:20:48 +00:00
|
|
|
`p` 标签的 `line-height` 属性值应为 `25px`。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
```js
|
|
|
|
assert($('p').css('line-height') == '25px');
|
2018-10-10 22:03:03 +00:00
|
|
|
```
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --solutions--
|
2020-02-11 07:46:34 +00:00
|
|
|
|