How to change the preview of a code on Webflow?

Tutorial
3 min
Published on Mar 21, 2023
Updated on
Preview of a Webflow icon with a code snippet in syntax highlight.
Use AI to summarize this article
Key points

Discover in this tutorial how to use the no-code solution "Attributes - Code Highlight" from Finsweet, to easily apply Highlight styling to your code snippets on Webflow.

Why use "Code Highlight"?

If you are a developer or if you publish technical content on your site, you understand how crucial it is to make your code easy to read and comprehend for your readers. And since a picture is worth a thousand words, I invite you to compare two identical code snippets below, with the only difference being the addition of a feature - Code Highlight -

Comparison of a code snippet with and without syntax highlighting
Code without syntax highlight (on the left) vs code with syntax highlighter (on the right)

As you can see, by using a syntax highlighter on your site, you can make your code more readable and visually appealing for your readers, which can enhance their reading experience and encourage them to stay longer on your website (or come back more often 🤗).

So, how can you add this customization option to the content of your Webflow site?

How to use the solution on your Webflow site?

Unfortunately, Webflow does not natively offer the integration of this feature on your website pages. But... the Finsweet attributes do!  And it only takes a few clicks.

→ Use the Finsweet Attributes - Code Highlight

  1. Go to the Finsweet "Code Highlight" documentation
  2. Copy the script
  3. Paste the script into the head tag of the page(s) where your code that you want to style is located
  4. Add the attribute "fs-codehighlight-element - code"
  5. Choose a theme
  6. Integrate your code between the following tags <!-- fs-richtext-ignore --><pre><code>   YOUR_CODE   </code></pre> (replace "YOUR_CODE" with your code)
  7. Publish your Webflow site! 🎉

And there you have it, in no time you have significantly improved the readability of your code snippets! As a bonus, this solution works for static elements, or can be directly integrated into the dynamic pages (CMS) of your site.

If you prefer, I also have a video tutorial in French, explaining how to integrate the solution into your website.

Florian Bodelot
Florian Bodelot
Co-founder

Suggested articles

Abstract illustration of an AI-powered marketing team, featuring a grid of purple and beige squares representing automation, connected workflows, and human-AI collaboration.
News
AI

The New Marketing Teams: What AI Has Actually Changed in How They Work

The New Marketing Teams: What AI Has Actually Changed in How They Work
Webflow vs. custom development with a headless CMS, illustrated by the Webflow Designer and a code editor.
Documentation
Development

Webflow vs. Custom Development (Next.js, Astro): 6 questions to make the right choice

Webflow vs. Custom Development (Next.js, Astro): 6 questions to make the right choice
PHP2Shell visual: CVE-2026-109618 and CVE-2026-109619 rated 9.2, terminal of a WordPress server on PHP 8.1 with no patch, Webflow site not affected
News
Webflow

PHP2Shell critical PHP vulnerability: what to do about your WordPress site, and should you move to Webflow?

PHP2Shell critical PHP vulnerability: what to do about your WordPress site, and should you move to Webflow?
Every great website  
starts with a conversation
Abstract composition of black and gold metallic ribbons with elegant light reflections and smooth gradients. A premium background conveying luxury, modernity, and innovation.