freeCodeCamp/curriculum/challenges/chinese/01-responsive-web-design/basic-css/adjust-the-margin-of-an-ele...

31 lines
733 B
Markdown
Raw Normal View History

---
id: bad87fee1348bd9aedf08822
title: 调整元素的外边距
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJarHW'
forumTopicId: 16654
---
# --description--
`margin外边距`控制元素的边框与其他元素之间的距离。
在这里,我们可以看到蓝色框和红色框都在黄色框里。请注意,红色框的`margin`值要比蓝色框的大,让它看起来比蓝色框要小。
当你增加蓝色的`margin`值,它会增加元素边框到其他周围元素的距离。
# --instructions--
蓝色的框`margin`的值要跟红色框的一样大小。
# --hints--
`blue-box` class 的`margin`值应为`20px`。
```js
assert($('.blue-box').css('margin-top') === '20px');
```
# --solutions--