--- id: bad87fee1348bd9aedf08824 title: Add Different Padding to Each Side of an Element challengeType: 0 guideUrl: 'https://chinese.freecodecamp.org/guide/certificates/add-different-padding-to-each-side-of-an-element' videoUrl: '' localeTitle: 在元素的每一侧添加不同的填充 --- ## Description
有时您会想要自定义一个元素,使其每边都有不同数量的padding 。 CSS允许您控制的padding与元素的所有四个单项两侧padding-toppadding-rightpadding-bottom ,并padding-left属性。
## Instructions
在蓝色框的顶部和左侧给出40pxpadding ,但在其底部和右侧只有20px
## Tests
```yml tests: - text: 你的blue-box类应该给出40px padding元素的顶部。 testString: 'assert($(".blue-box").css("padding-top") === "40px", "Your blue-box class should give the top of the elements 40px of padding.");' - text: 你的blue-box类应该给出20px padding元素的权利。 testString: 'assert($(".blue-box").css("padding-right") === "20px", "Your blue-box class should give the right of the elements 20px of padding.");' - text: 你的blue-box类应该给出20px padding元素的底部。 testString: 'assert($(".blue-box").css("padding-bottom") === "20px", "Your blue-box class should give the bottom of the elements 20px of padding.");' - text: 你的blue-box类应该给元素左边padding 40px 。 testString: 'assert($(".blue-box").css("padding-left") === "40px", "Your blue-box class should give the left of the elements 40px of padding.");' ```
## Challenge Seed
```html
margin
padding
padding
```
## Solution
```js // solution required ```