# 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="https://115503993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVRpgq7lelxP9PFleE0QT%2Fuploads%2F2Tc6TrobxH97oWVdPZBa%2FScreenshot%202025-05-09%20at%203.07.08%E2%80%AFAM.png?alt=media&#x26;token=523f713b-7906-4698-88ba-eaaf4157696c" alt=""><figcaption></figcaption></figure>
