From the course: CSS Essential Training

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Padding, margin, and border

Padding, margin, and border

- [Instructor] Let's continue with our exploration of the box model properties. In this video, we'll go over padding, border, and margin. The padding property defines the space that surrounds the content box. The space is also added inside the element. Padding is defined with length or percentage values. When using a value of zero, it could be written with or without a unit. And that applies anytime the value of zero is used, not just with padding. Padding can also be defined with one to four values. When using one value, the same amount is added to all sides equally. With two values, the first sets the padding for the top and bottom, while the second value sets the padding for the left and right sides. With three values, the first is applied to the top, the second to the right, and left, the third to the bottom. And four values applies the padding to each side in a clockwise direction. Top, right, bottom, and left.…

Contents