How can I add a CSS function recommended by Google Pagespeed Insights in Webflow using custom code?

TL;DR
  • Access Webflow's Project Settings, navigate to the Custom Code tab, and insert the CSS within <style> tags in the Head Code section.
  • Save the changes and publish the site to apply the new CSS function.

To add a new CSS function as recommended by Google PageSpeed Insights to your Webflow project, you'll need to use custom code. Here's how you can effectively implement this.

1. Access Project Settings

  • Go to Project Settings by clicking on the project you want to modify.
  • Navigate to the Custom Code tab located at the top of the settings page.

2. Add CSS Code

  • In the Head Code section, paste the CSS function provided by Google PageSpeed Insights.
  • Ensure you wrap your CSS within <style> tags. For instance: <style>/ Your CSS here /</style>.
  • Save your changes by clicking on the Save button located at the bottom of the page.

3. Publish Your Site

  • Publish your changes to see them take effect by clicking on the Publish button.
  • Choose whether to publish to the staging domain or the custom domain, as needed.

Summary

To incorporate a CSS function from Google PageSpeed Insights into your Webflow project, utilize the Custom Code section under Project Settings, ensuring to wrap your CSS in <style> tags, and don’t forget to publish the site for the changes to take effect.

Rate this answer

Other Webflow Questions