---
id: bad87fee1348bd9aedf08824
title: Add Different Padding to Each Side of an Element
challengeType: 0
videoUrl: 'https://scrimba.com/c/cB7mwUw'
forumTopicId: 16634
localeTitle: 给元素的每一侧添加不同的内边距
---
## Description
有时候,你会想给一个元素每个方向的padding都设置成一个特定的值
CSS 允许你使用padding-top,padding-right, padding-bottom和padding-left属性来设置四个不同方向的padding值。
## Instructions
蓝色框的顶部和左侧的padding值设置为40px,底部和右侧设置为20px。
## Tests
```yml
tests:
- text: 'blue-box class 的顶部padding(上内边距)值应为40px。'
testString: assert($(".blue-box").css("padding-top") === "40px");
- text: 'blue-box class 的右侧padding(右内边距)值应为20px。'
testString: assert($(".blue-box").css("padding-right") === "20px");
- text: 'blue-box class 的底部padding(下内边距)值应为20px。'
testString: assert($(".blue-box").css("padding-bottom") === "20px");
- text: 'blue-box class 的左侧padding(左内边距)值应为40px。'
testString: assert($(".blue-box").css("padding-left") === "40px");
```
## Challenge Seed
```html
margin
padding
padding
```
## Solution
```html
// solution required
```