Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using an SVG as background in a Confluence plugin

martin June 2, 2015

I'm trying to use an .svg-image as background via CSS in a Confluence plugin. When I try to access it the browser gives me a download link. Could it be that the mime-type for SVG is not setup correctly? If so how do I add it? 

 

Thanks in advance!

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
martin June 2, 2015

Okay, internet tells me this has been an issue for some time, I'd be very happy just having the mime-type added to the servers list of supported file types. Which would probably solve my issue. 

But anyhow, I ended up embedding the svg directly in my CSS, much like you'd do when embedding png's.

.bg { 
  background: url('data:image/svg+xml; ... '); 
}

Plus, I found this article suggesting that embedding them in utf-8 is better than converting to base64:

https://css-tricks.com/probably-dont-base64-svg/

 

Cheers,

TAGS
AUG Leaders

Atlassian Community Events