tags to display code blocks.
Webflow’s native Rich Text element does not support true code blocks or preformatted code display (like JSON) out of the box. You’re limited to basic formatting: bold, italic, lists, headers, quotes, and links.
Here’s how to work around this limitation effectively:
<pre>
and <code>
tags.<pre><code>{ "key": "value" }</code></pre>
.<style>
tag.<pre>
or <code>
tags (e.g., font-family: monospace; background-color: #f5f5f5; padding: 1rem).).
language-json
) to your <code>
elements to activate syntax highlighting.<pre><code>
tags using a Webflow Embed element.Webflow’s native Rich Text element does not support code blocks, but you can show JSON or other preformatted code using a custom Embed with <pre><code>
tags and optional syntax highlighting libraries. For CMS content, use a separate text field and bind it in a styled Text Block.