Michaud Christian Emmanuel Cédar
PRO
last month
Michaudcountry asked

If I write padding: 10px 30px 20px;, does that mean 10px for the top, 30px for both left and right, and 20px for the bottom—is that correct?

Kelish Rai
Expert
last month
Kelish Rai answered

That's right. When you provide three values to the padding property, the first value applies to the top padding, the second value to the left and right (sides), and the third value to the bottom padding.

You can think of it like this:

padding: top sides bottom;

So, in the example:

padding: 10px 30px 20px;

It will apply:

  • 10px to the top,

  • 30px to both the left and right sides, and

  • 20px to the bottom.

Feel free to ask if you have more questions—I'm happy to help.

CSS
This question was asked as part of the Learn CSS course.