How to Modify Webflow's Default Underline for Better Readability

Tutorial
September 6, 2023
3 min
How to change the default underline in Webflow for better readability
Key points

Introduction

In a Webflow project at Digidop, we believe that every detail matters. However, there are times when some default elements in Webflow can cause minor issues. This is precisely what we will address in this article.

If you are accustomed to developing websites on Webflow, you may have already noticed that the default underline is very close to the text (much closer than the default underline in a Figma mockup, for example), which can affect the aesthetics and readability of your designs.

But don’t worry, we have the solution to this problem, and it is extremely simple as it only involves a tiny line of custom CSS code that you can consistently integrate into your Webflow sites.

In this article, we will show you how to easily incorporate this adjustment into your projects. Let’s get started!

The Default Underline Issue in Webflow

The default underline in Webflow is actually very close to the text itself, almost merging with the letters, which can create an aesthetic that doesn't always align with your design vision.

To illustrate this, let’s compare it with the default underline in Figma mockups:

Webflow Underline vs Figma Underline

When you create underlined text in Figma, you’ll notice that the underline is positioned lower, which enhances the overall readability of the text. In contrast, in Webflow, the rendering is not the same, and that’s where we come into play.

The Quick Solution with Custom CSS Code

Now that the problem is identified, let’s move on to the solution. Fortunately, this solution is incredibly straightforward: all you need is a line of custom CSS code.

The magic line we will use is as follows:

body {text-underline-offset: .25em;}

By adding this to your Webflow project, you adjust the gap between the text and the underline to 0.25em (a relative unit of measurement based on the font size).

To apply this effect to your site, follow these steps.

If you’re using the Client-First cloneable:

  • From the Designer browser, open the Global Styles component, then the Embed inside to access the global styles of Client-First.
Webflow, Client-First Global Styles
  • Once opened, scroll to the top of the Embed to the styles that enhance readability.
Webflow, Client-First Text Enhancement
  • Finally, just add the following line to the Body element (as shown in the image).
text-underline-offset: .25em;
Webflow, Client-First Underline

If you are creating a project from scratch and not using the Client-First cloneable:

  • Open the site settings and go to the Custom Code tab.
  • Copy and paste the following code into the header:
<style>
body {text-underline-offset: .25em;}
</style>
Webflow, Site Settings Underline

You can also, similar to the Client-First setup, create a global Embed in which to add this custom code so that the styles are visible in the Designer (adding CSS in the custom code in the page or site settings will not show the changes in the Designer).

Lastly, after adding the line of code and possibly adjusting the value, make sure to publish your site. It’s as simple as that!

Conclusion

Congratulations! You now have a new simple yet very practical tip in your Webflow toolkit.

Every little detail matters in creating an exceptional user experience: adjusting the underline is no exception as it contributes to making your website text more aesthetically pleasing and readable.

To delve deeper, read our latest articles:

…or check out our YouTube channel!

Lucas Clairet
Lucas Clairet
Creative Solutions Developer & Webflow Expert

Suggested articles

Webflow Localization, Credial's Use Case
Documentation
Webflow

Webflow Localization: Practical Guide & Credial's Use Case

Webflow Localization: Practical Guide & Credial's Use Case
Visuel showcasing digidop.fr switching to digidop.com
News
Digidop

Digidop.fr is now Digidop.com

Digidop.fr is now Digidop.com
Photo of the Digidop team with the Digidop Logo 2024
News
Digidop

A Look Back at an Exceptional 2024 and Vision 2025

A Look Back at an Exceptional 2024 and Vision 2025

Want to turn your website into your most valuable asset?

Contact us today