> For the complete documentation index, see [llms.txt](https://docs.gutenbricks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gutenbricks.com/features/advanced/block-wrapper-dynamic-class.md).

# Block Wrapper Dynamic Class

The HTML structure inside the Block Editor may differ slightly from the one rendered on the frontend. Most notably, an extra wrapper \<div> around the actual block content.

<figure><img src="https://115503993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVRpgq7lelxP9PFleE0QT%2Fuploads%2FeVkGivfXbUxRwaTQSVZ6%2FScreenshot%202024-10-03%20at%203.56.37%E2%80%AFPM.png?alt=media&amp;token=90c7796f-6829-4eb4-996f-0d5847e41480" alt=""><figcaption><p>Inside Gutenberg editor, the &#x3C;div> in the red box is a wrapper wrapping &#x3C;section> which is the actual content. Of course the &#x3C;div> wrapper is only for Gutenberg Editor to keep tracking and managing the blocks and not rendered in the frontend.</p></figcaption></figure>

In this case, some CSS applied to the outermost element might not work. For eg, `grid-column` that requires the immediate parent to be a grid.&#x20;

To solve this issue, users can add dynamic classes to outermost block wrapper using Block Wrapper Dynamic Class (under template settings -> Gutenbricks:Block.)

<figure><img src="https://115503993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVRpgq7lelxP9PFleE0QT%2Fuploads%2FRWWfI7X70BFlk9vKE07f%2FScreenshot%202024-10-03%20at%204.08.16%E2%80%AFPM.png?alt=media&amp;token=4fc7e280-cdd5-44de-a2ae-02cf1f7f10e4" alt=""><figcaption></figcaption></figure>

For example, you can declare something like `cold-span-{dynamic_variable}`  and the dynamic class will be applied to the block wrapper like this:&#x20;

<figure><img src="https://115503993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVRpgq7lelxP9PFleE0QT%2Fuploads%2FJb2n7cCnCsNRQzok3ofi%2FScreenshot%202024-10-03%20at%204.30.13%E2%80%AFPM.png?alt=media&amp;token=99e426f1-ff10-4f2b-99a9-e6a0709faf9e" alt=""><figcaption><p>col-span-5 has been applied to the block wrapper where "5" is from dynamic_variable.</p></figcaption></figure>

Now you can see `column-span` working because the block wrapper which is the grid's immediate child has `col-span-5` class.

<figure><img src="https://115503993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVRpgq7lelxP9PFleE0QT%2Fuploads%2FzlIFl65AgdMUpnvTZsyP%2FScreen%20Recording%202024-10-03%20at%204.28.58%E2%80%AFPM.gif?alt=media&amp;token=a9102d98-ceb8-4db1-9f3e-3fabc1127de1" alt=""><figcaption></figcaption></figure>
