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
From the course: CSS Essential Training
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.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Introduction to the CSS box model1m 4s
-
(Locked)
Width, height, and display3m 7s
-
(Locked)
Padding, margin, and border4m 59s
-
(Locked)
Center-aligning with margin3m 7s
-
(Locked)
Box-sizing and the box model fix3m 31s
-
(Locked)
Working with developer tools5m 1s
-
(Locked)
Margin collapse and inline spacing2m 48s
-
(Locked)
Creating full-height layouts3m 2s
-
(Locked)
Project: List reset and header updates4m 51s
-
(Locked)
Project: Centering content with margin5m 49s
-
(Locked)
Project: Heading resets and border styles4m 4s
-
(Locked)
-
-
-
-
-
-