AnsweredAssumed Answered

How do I make a relative path/link in a custom CSS to reference the file hosted in the course?

Question asked by Denis Marchi on Jun 27, 2019
Latest reply on Jun 27, 2019 by Stefanie Sanders
I'm creating a theme for Canvas using a customized CSS file. My idea is to create a kind of layout/template that will use an image hosted inside the files folder of each course - I want to use a "background.png" file, and each course would have a different version of this file in its files folder.
How do I make a relative path/link so that it would automatically reference the file hosted in the course I put the link in?
For example, imagine a course of id 01, and another of id 02. Both would use a background image hosted in their own files folder. Then, in my CSS file I'd have something like this:
Background-image: url(/files/bg.png)
But those two courses would print different backgrounds, since I'd have two different file names "bg.png", each in their respective files folder. Could I create this kind of relative path/link here? If so, how?