Forum Discussion
Reference iFile inside CSS file - Is it possible?
- May 03, 2021
Sorry, not sure if we can add ifile within ifile. We will keep this discussion open for others to comment.
But just a thought, why can't you look for an option to update current primary css file to add image file there. something like b64 encoded image?
https://stackoverflow.com/questions/17090571/is-there-a-way-to-set-background-image-as-a-base64-encoded-image
yes, you can reference css ifile. Import the css file on F5 and use below code
<ifilename> = example.css
switch -glob [string tolower [HTTP::uri]] {
"*/css" {HTTP::respond 200 content [ifile get <ifilename>] "Content-Type" "text/css"}
- Xterminator89May 03, 2021Altocumulus
Thanks Sanjay, but my question was different, I'll elaborate on it: within the referenced CSS iFile, is it possible to reference another iFile, which would contain a JPG ? If not, how can I approach this issue, and not rely on external resources?
Thanks for any reply
- spalandeMay 03, 2021Nacreous
Sorry, not sure if we can add ifile within ifile. We will keep this discussion open for others to comment.
But just a thought, why can't you look for an option to update current primary css file to add image file there. something like b64 encoded image?
https://stackoverflow.com/questions/17090571/is-there-a-way-to-set-background-image-as-a-base64-encoded-image
- Xterminator89May 03, 2021Altocumulus
Thanks Sanjay. I didn't think about that approach.
I have converted the image to Base64, and it looks like the solution is OK.
Thanks a lot for your input
- spalandeMay 03, 2021Nacreous
Glad I was of some help :)
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com