Can I upload .css as .txt and load them similar to how .js can be loaded in Webflow?

Published on
September 22, 2023

Yes, you can upload .css files in Webflow as .txt files and load them similarly to how .js files can be loaded. Here's how you can do it:

  1. Rename your .css file to .txt: Before uploading your .css file, you need to rename it to have the .txt extension. This is because Webflow restricts file upload to certain file types, and .css is not one of them. By renaming it to .txt, you can bypass this restriction.

  2. Upload the .txt file to your Webflow project: In your Webflow project, navigate to the Assets panel by clicking on the "Assets" tab on the left side of the designer. Then, click on the "Upload" button and select your renamed .txt file. The file will now be uploaded to your project.

  3. Load the .txt file as a stylesheet: To load the .txt file as a stylesheet in Webflow, you'll need to insert a <style> tag in the head of your project.

  • Go to the Designer and click on the "Project Settings" icon (the gear icon) in the top-right corner.

  • In the "Custom Code" tab, scroll down to the "Custom Head Code" section.

  • Insert the following code into the "Custom Head Code" box:

    ```html

    ```

    Make sure to replace "/your-folder/your-file.txt" with the actual path to your .txt file. This will import the file as a stylesheet and apply its styles to your webpages.

  1. Save and publish your project: After adding the code, save your changes and publish your project to make the updated styles take effect on your live site.

By following these steps, you'll be able to load your .css file (renamed as .txt) and apply its styles to your Webflow project.

Additional Questions:

  1. How do I rename a file in Webflow?
  2. Can I upload other file types in Webflow?
  3. How can I edit the custom code in my Webflow project?