# 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="/files/f8RiOk1QwvWQCNrPSPq3" 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="/files/LXfKD0o8dQVlynZZYwLx" 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="/files/dSu1qJfdgGZ7810eGLI5" 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="/files/stG76W3663GHmU4V0R1j" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gutenbricks.com/features/advanced/block-wrapper-dynamic-class.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
