Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Grid System does not work inside mat-expansion-panel

When using the Boostrap 4 grid system inside the Angular/Material mat-expansion-panel, the grid elements do not fit into the grid. All elements in a row do not fit and the last element carries over to a new line.

like image 833
Codewise Avatar asked Jul 20 '18 13:07

Codewise


People also ask

What is the meaning of Col SM 4 in Bootstrap?

col-sm-4 applies to small, medium, large, and extra large devices, but not the first xs breakpoint). You can use predefined grid classes (like . col-4 ) or Sass mixins for more semantic markup.

What is the class prefix used in Bootstrap grid system for extra small devices that are 576px?

Grid Classescol- (extra small devices - screen width less than 576px) . col-sm- (small devices - screen width equal to or greater than 576px)

What does Md mean in Bootstrap?

The Bootstrap v4 grid system has five tiers of classes: xs (extra small), sm (small), md (medium), lg (large), and xl (extra large). You can use nearly any combination of these classes to create more dynamic and flexible layouts.

How many grid structures does Bootstrap follow?

Bootstrap's grid system can adapt across all six default breakpoints, and any breakpoints you customize. The six default grid tiers are as follow: Extra small (xs) Small (sm)


1 Answers

The Bootstrap grid system expects all elements to have the box-sizing set to border-box. To fix this just add the following css to your page.

.mat-expansion-panel{
    box-sizing: border-box;
}
like image 195
Codewise Avatar answered Sep 21 '22 10:09

Codewise