Nesting Columns

7 minutes
Share the link to this page
You need to have access to the item to view this lesson.
One-time Fee
List Price:  $139.99
You save:  $40
List Price:  €131.19
You save:  €37.48
List Price:  £112.24
You save:  £32.07
List Price:  CA$192.60
You save:  CA$55.03
List Price:  A$217.25
You save:  A$62.07
List Price:  S$190.37
You save:  S$54.39
List Price:  HK$1,096.25
You save:  HK$313.23
CHF 90.89
List Price:  CHF 127.26
You save:  CHF 36.36
NOK kr1,101.16
List Price:  NOK kr1,541.68
You save:  NOK kr440.51
DKK kr699.21
List Price:  DKK kr978.92
You save:  DKK kr279.71
List Price:  NZ$236.19
You save:  NZ$67.48
List Price:  د.إ514.11
You save:  د.إ146.90
List Price:  ৳15,319.96
You save:  ৳4,377.44
List Price:  ₹11,694.97
You save:  ₹3,341.66
List Price:  RM669.64
You save:  RM191.34
List Price:  ₦181,567.03
You save:  ₦51,880
List Price:  ₨38,857.05
You save:  ₨11,102.81
List Price:  ฿5,147.32
You save:  ฿1,470.77
List Price:  ₺4,550.80
You save:  ₺1,300.32
List Price:  B$732.62
You save:  B$209.33
List Price:  R2,665.20
You save:  R761.54
List Price:  Лв256.41
You save:  Лв73.26
List Price:  ₩192,455.38
You save:  ₩54,991.18
List Price:  ₪530.55
You save:  ₪151.59
List Price:  ₱8,009.48
You save:  ₱2,288.58
List Price:  ¥21,617.62
You save:  ¥6,176.90
List Price:  MX$2,374.63
You save:  MX$678.51
List Price:  QR509.31
You save:  QR145.52
List Price:  P1,929.29
You save:  P551.26
List Price:  KSh18,618.67
You save:  KSh5,320
List Price:  E£6,790.31
You save:  E£1,940.22
List Price:  ብር7,942.45
You save:  ብር2,269.43
List Price:  Kz117,241.62
You save:  Kz33,500
List Price:  CLP$137,040.41
You save:  CLP$39,157.20
List Price:  CN¥1,013.40
You save:  CN¥289.56
List Price:  RD$8,251.22
You save:  RD$2,357.66
List Price:  DA18,826.63
You save:  DA5,379.42
List Price:  FJ$317.87
You save:  FJ$90.82
List Price:  Q1,085.64
You save:  Q310.20
List Price:  GY$29,225.48
You save:  GY$8,350.73
ISK kr14,084.59
List Price:  ISK kr19,718.99
You save:  ISK kr5,634.40
List Price:  DH1,416.82
You save:  DH404.83
List Price:  L2,505.87
You save:  L716.01
List Price:  ден8,074.51
You save:  ден2,307.16
List Price:  MOP$1,125.87
You save:  MOP$321.70
List Price:  N$2,657.05
You save:  N$759.21
List Price:  C$5,137.77
You save:  C$1,468.04
List Price:  रु18,685.75
You save:  रु5,339.16
List Price:  S/525.19
You save:  S/150.06
List Price:  K530.57
You save:  K151.60
List Price:  SAR525.14
You save:  SAR150.05
List Price:  ZK3,528.03
You save:  ZK1,008.08
List Price:  L652.66
You save:  L186.48
List Price:  Kč3,316.71
You save:  Kč947.70
List Price:  Ft51,682.51
You save:  Ft14,767.48
SEK kr1,089.22
List Price:  SEK kr1,524.96
You save:  SEK kr435.73
List Price:  ARS$121,682.87
You save:  ARS$34,769.02
List Price:  Bs966.66
You save:  Bs276.20
List Price:  COP$547,598.77
You save:  COP$156,467.96
List Price:  ₡69,943.14
You save:  ₡19,985.18
List Price:  L3,446.12
You save:  L984.67
List Price:  ₲1,033,044.43
You save:  ₲295,176.63
List Price:  $U5,445.86
You save:  $U1,556.07
List Price:  zł568.23
You save:  zł162.36
Already have an account? Log In


Hello, in this bootstrap four video, we're going to cover how to nest columns. So what is nesting columns? It basically allows you to put columns and rows within each other. You might be thinking, why do you want to do that? Well, you may have noticed that I said a few videos ago that you can only have a maximum of 12 columns. That's still a bootstrapping design.

And they have to be whole numbers. So you can't have 6.5. Or you can have, let's say, 7.5, or something like that. But it did briefly say that technically, the way to get around that and nesting columns is that way, you don't just use nesting columns to get around that. But it's also a great way of grouping content even more so you could group the overall set of content and maybe in net group, there's several more pieces of content that you want to group. So for example, we've got this element at the top right Yeah, and for the extra last screen, so I'm gonna set it to six, refresh my browser, they go, it's six columns wide so far doesn't go to my text data.

And now inside the I'm just gonna actually delete the text and put another row. So this is how you nest column, you have to put another row inside a class row. Now inside here, you put another div, and this is a class. For this, you simply put call dash, the screen size, and then the amount of columns that you want to spend. And here's the key part. If I were to put a dash XL dash 12, this spans 12 columns, but it's spanning 12 columns in terms of Have its parent element and its parent element spanned six columns.

So if I were to put six columns, it technically spanning a quarter of the entire row because this element is spanning half of the line, and this is Spanish half of that element, aka this one here. So in here, I'm going to put div one. And I'm going to assign a color actually, we're going to create a new color for sure dye. Now won't bother. I'll use an existing color. Oh, he will use blue.

Actually, I'm also going to delete these just to make it a little easier. I'm going to copy and paste this I'm gonna change this to it to change this to green. Save it, go to my browser refresh. And as you can see, we've got a blue and green element. But if we have a look, we only have one element right here, which is red and reason we can't see any red because they're covered by it's too Child Elements. And like I said, even though we have a column size of six and a column sizes six, it doesn't span half of the screen, it spans half of its parent.

And that's technically the same with what this is doing is just because this doesn't have any other elements above it, that are set to an X amount of column space, it's actually just spanning the width of the body aka right to should I should really say the row in the container which is within the body, hence why this is working like it is so forward to put this thing for. Save it. refreshed, empty, there's a big red day because we got this element that span four columns, this element span six columns. So four plus 10. I mean, four plus six is 10. A total of 12 columns available.

12 Minus 10 is two, and we have two left over. So you don't have to fill all 12 columns, the principle is exactly the same as regular columns. So if I were to, let's say, copy and paste this, Olivia's the color green, and I'll put this I'll leave it as six. Put it as div three, refresh, and it's on a separate line, because there were only two columns left, but the free spanned six columns, hence, you went on Innova line. Again, it's the same principle as using columns as we have done before. And finally, I'm just going to show you can actually go even further and just add as many nested columns as you want.

So if I were to just do another div, row and inside here, I think you guessed it, you need to put another div with class called XML. And for this, I'm gonna put dash free dash for actually copy and paste this. I'm actually not gonna put any content in it, I'm just going to style it with some color. So I'm going to put red, green and blue, green, blue, go back refresh. You can see right at the top active progress for the put some content in the north one and two, because otherwise it's gonna be not very, very hard. See, so if I go back, refresh, so there we go, we've got one, and we have two, we just go back to it to do, you might be thinking, boy, this is spanning more than this.

It's not, it's just the background is blue as well. So if I actually change that to a red color, blue wasn't the best color, jus go back, refresh, and there we go. We've got color, we got a column, or element which spans six columns. Within that we have a number column, which spans I believe it was four spans four columns. Then within that, we got two more elements that span four columns each and there are four columns left over. So there you go.

That's how to nest columns within each other flower to start resizing this door. reason the nesting isn't working anymore It simply because we only applied it to the extra large screen size principle is the same, like I've said as columns. So if you want nest in to be done on the smaller screen sizes, you just have to apply the appropriate column, screen size and the column number of columns that you want it to span and also you can use column offsetting as well. So this is it for nesting columns. If you have any questions, feel free to post them on sonar learning coda UK for slash question dot php, there'll be a link in the description to that. Plus, there'll be another link to the source code from this video.

Please rate, comment and subscribe and it does really help keep the content free, and he also helps us provide more content on a regular basis. And as usual, thanks for watching.

Sign Up


Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.