From the course: Bootstrap 4 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Margin and padding

Margin and padding - Bootstrap Tutorial

From the course: Bootstrap 4 Essential Training

Start my 1-month free trial

Margin and padding

- [Narrator] One of the richest group of classes in Bootstrap are the Spacing classes. Now this mimics exactly the margin and padding classes in CSS. They look really complicated, but once you get used to them you'll pick them up pretty quickly. So let's take a look at how they work. This is a very complicated looking formula, but it actually is pretty straightforward. So you start by specifying a property right here, like margin or padding. So then you would specify one of the sides. So you could say something like padding top, or padding bottom, padding x for both the left and right sides or padding y, and then, that would mean the top and bottom. Now notice that there is no hyphen between the "p" or the "m" and then one of the sides. Then optionally, you could specify a break point here, so that does get a hyphen. So you could say padding y on the xl break point only, and then you can specify one of the sizes. So the sizes go from zero to five, and essentially the base size for…

Contents