Reference a CSS file in the File Library | XM Community
Skip to main content
Question

Reference a CSS file in the File Library


Forum|alt.badge.img+9
  • Level 2 ●●
  • 61 replies
Hi everyone - I'm having trouble using a CSS file in the File Library of Qualtrics. I go to the file -> view file -> copy the link -> past the link in the Look & Feel 'External CSS' box of the Qualtrics survey. But of course the link is a .php jumbled reference, so I'm not sure how to directly reference the css file itself. Referencing it this way is not working. Any idea how to reference files inside of your File Library for use like this? I do not want to host the CSS file on another server if I don't have to.

8 replies

mattyb513
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • 163 replies
  • March 20, 2019
This probably isn't helpful, but I can confirm it doesn't work! I've tried it a number of ways. The odd thing is that the browser recognizes it, reads the file, even identifies it as a stylesheet via the mime type, but for some reason doesn't apply the style

  • 2 replies
  • June 12, 2019
The link itself to File.php with the file unique identifier is actually fine. The problem is that when File.php serves the css file, it doesn't set the response header that allows the file to be interpreted as a style sheet. It should be 'text/css' but it's set to 'text/plain'. https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#textplain Unless Qultrics adds CSS support to the files library, the only way I know to make this work is to load the file with javascript and inject the contents into a style block. This is likely more trouble than it's worth.

Forum|alt.badge.img+9
  • Author
  • Level 2 ●●
  • 61 replies
  • October 24, 2019
Just updating the thread that this is still an issue. All CSS files are being hosted externally, outside of Qualtrics for my projects.

fleb
Level 3 ●●●
Forum|alt.badge.img+6
  • Level 3 ●●●
  • 197 replies
  • October 26, 2019
Just for others who'd also try to solve this: I've tried to import the stylesheet using `<link rel="stylesheet" href="URL"> `and it also didn't help. Using the old Look&feel editor also not... @Pete_L : Have you tried to contact the Qualtrics support about this issue? I think this should work...

Forum|alt.badge.img+9
  • Author
  • Level 2 ●●
  • 61 replies
  • October 28, 2019
@fleb - You can go to the Look & Feel > Header > Source View and paste that html code there and it will work correctly 😀 That's how I'm currently handling it for my projects. I have not contacted Qualtrics support but will go ahead and put in a feature request for this now that the new "Idea" thread exists!

  • 15 replies
  • January 28, 2021

when you say paste that html code...are you pointing to the css file in the File Library? it still doesnt work for me:
image.png


Forum|alt.badge.img+9
  • Author
  • Level 2 ●●
  • 61 replies
  • April 15, 2021

icegoffy sorry for the slow reply! We are hosting the files externally outside of Qualtrics.
We have never been able to get it to work using the Qualtrics library.


Forum|alt.badge.img+3
  • Level 2 ●●
  • 3 replies
  • July 19, 2023

My workaround was to set the type in that head to text/plain. However, I’m not sure if that’s really secure or not. If something changes or there’s a better way to set the mime type to text/css when I initially save the file before uploading to Qualtrics, I’d be open to that.


Leave a Reply