Is it possible to convert a regular plain text into a relative link using custom code in Webflow?

Published on
September 22, 2023

Yes, it is possible to convert a regular plain text into a relative link using custom code in Webflow.

Here's a step-by-step guide on how to achieve this:

  1. Add a plain text element to your Webflow project.
  2. Give the plain text element a unique class name by selecting it in the Designer and adding a class in the right sidebar.
  3. Go to the Custom Code section in your Project Settings.
  4. Under the <head> tag, add a <style> tag to define the class you created for the plain text element. For example, if you named the class "link-text", your code would be:
<style>.link-text {    color: blue;    text-decoration: underline;    cursor: pointer;}</style>
  1. Save your changes and publish your site.
  2. Head back to the Designer and select the plain text element you want to turn into a relative link.
  3. In the right sidebar, go to the "Link Settings" section.
  4. Enable the "Link settings" option by clicking on the checkbox.
  5. In the "Link" field, enter the relative URL you want the plain text to link to. Make sure to use the correct format for relative links (e.g., "/about-us" for a link to the "about-us" page).
  6. To make the plain text element look like a link, apply the class you defined in your custom code to the plain text element. You can do this by adding the class name to the "Class" field in the right sidebar (e.g., "link-text").
  7. Save your changes and publish your site again.
  8. Now, when a visitor clicks on the plain text, they will be directed to the relative URL you specified.

By following these steps, you can convert a regular plain text into a relative link using custom code in Webflow.

Additional questions:

  1. How can I convert a plain text element into a relative link in Webflow?
  2. What is the process for adding a custom class to a plain text element in Webflow?
  3. How can I use custom code to create a clickable link from plain text in Webflow?