> 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/code-block-with-dynamic-data.md).

# Code Block with Dynamic Data

{% embed url="<https://youtu.be/4LJCa_3yQc4>" %}

Using dynamic data inside Bricks' Code Block is the most powerful and flexible way to control a block. You can allow users to control those dynamic data by exposing Dynamic Data as a form field in Gutenberg editor.&#x20;

### Use {gb\_block\_id} to scope block CSS properly

To have CSS to select a specific block, you can use {gb\_block\_id}. In the example below, the specific CSS is only applied to a block with class `.block-{gb_block_id}`

<pre class="language-css"><code class="lang-css">.block-{gb_block_id} .brxe-rating .full-color {
  color: {gbmeta_star_rating_color};
<strong>}
</strong></code></pre>

IMPORTANT: You MUST add `block-{gb_block_id}` to a parent element by using Dynamic Class.

<figure><img src="/files/kC7cp59teP0o5icsLSGg" alt=""><figcaption></figcaption></figure>
