# CSS-Grid ignores Container-Class

**URL:** <https://forum.bootstrapstudio.io/t/css-grid-ignores-container-class/8485>\
**Category:** Webdesign Help\
**Created:** [March 3, 2022, 7:34am UTC](https://forum.bootstrapstudio.io/t/css-grid-ignores-container-class/8485 "2022-03-03T07:34:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rumede](https://forum.bootstrapstudio.io/letter_avatar_proxy/v4/letter/r/a6a055/32.png) [@rumede](https://forum.bootstrapstudio.io/u/rumede)\
**Post date:** [March 3, 2022, 7:34am UTC](https://forum.bootstrapstudio.io/t/css-grid-ignores-container-class/8485/1 "2022-03-03T07:34:21Z")

</div>

A question about CSS Grid: This is now integrated in Bootstrap and also documented accordingly:  
`https://getbootstrap.com/docs/5.1/layout/css-grid/`

I find this an exciting approach, since e.g. also Worpress builds their grid with this kind. I have set up the test times so. But what I have noticed now…

The CSS grid takes the whole width of the window. Even if I make a div with the class “Container” around the grid. The bootstrap grid listens to the class `Container`, the CSS grid does not. This is a pity, because so also the whole widths for the breakpoints don’t work.

Does anyone have experience with this? How did you solve this?

---

<div class="post-metadata">

**Author:** ![michalbialkowski](https://forum.bootstrapstudio.io/user_avatar/forum.bootstrapstudio.io/michalbialkowski/32/5045_2.png) [@michalbialkowski](https://forum.bootstrapstudio.io/u/michalbialkowski)\
**Post date:** [March 3, 2022, 10:12am UTC](https://forum.bootstrapstudio.io/t/css-grid-ignores-container-class/8485/2 "2022-03-03T10:12:07Z")

</div>

This is possible by using the original Bootstrap SCSS files in the project.  
If you do this, you can enable the CSS Grid option in the \_variables.scss file

---

<div class="post-metadata">

**Author:** ![rumede](https://forum.bootstrapstudio.io/letter_avatar_proxy/v4/letter/r/a6a055/32.png) [@rumede](https://forum.bootstrapstudio.io/u/rumede)\
**Post date:** [March 3, 2022, 10:34am UTC](https://forum.bootstrapstudio.io/t/css-grid-ignores-container-class/8485/3 "2022-03-03T10:34:38Z")

</div>

I have this variables in my custom.css

$enable-grid-classes: false;  
$enable-cssgrid: true;

---

<div class="post-metadata">

**Author:** ![kuligaposten](https://forum.bootstrapstudio.io/user_avatar/forum.bootstrapstudio.io/kuligaposten/32/1190_2.png) [@kuligaposten](https://forum.bootstrapstudio.io/u/kuligaposten)\
**Post date:** [March 4, 2022, 2:01pm UTC](https://forum.bootstrapstudio.io/t/css-grid-ignores-container-class/8485/4 "2022-03-04T14:01:10Z")

</div>

> **[CSS grid](https://css-grid.bss.design/)**
>
> You don't need to activate the bootstrap css grid
> to have a css grid
> Learn CSS Grid the easy way
> author: Kevin Powell
