mirror of
https://github.com/lipis/flag-icons.git
synced 2026-04-26 17:35:54 +03:00
[GH-ISSUE #246] Flags as SVG images not displaying in Firefox #160
Labels
No labels
3rd-party
3rd-party
bug
code
documentation
enhancement
fixed-in-master
flag-request
help needed
missing-flag
missing-flag
pull-request
wrong-flag
wrong-flag
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/flag-icons#160
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @victorkristof on GitHub (May 24, 2016).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/246
Hello,
I'm using the flags as SVG
image:It works well on Safari and Chrome, but they are not displayed on Firefox. The solution is to add a
viewBoxattribute to the rootsvgelement of the flags (example with Germany 1x1):Would it be possible to add that for every flag ?
Thanks!
@lipis commented on GitHub (May 24, 2016):
Maybe using
<img src="flags/1x1/de.svg">instead of<image href="...">will improve dramatically your chances of making it work..@victorkristof commented on GitHub (May 24, 2016):
Except that I use them in an interactive D3.js Sankey diagram (i.e., within an
svgelement), where images are sourced with an<image>tag.@lipis commented on GitHub (May 24, 2016):
But this library here doesn't provide any raster images... so I'm not sure what you are trying to achieve..
@victorkristof commented on GitHub (May 24, 2016):
I'm doing something like this (interactive SVG):

However, in Firefox it it displayed like that:

Unless I add the
viewBox, like I did for the german flag.I was using these SVGs since I'm using them as CSS in other places. But you're right, maybe I should use raster images. Just thought it was easier like that :)
@cristianFainis commented on GitHub (Apr 2, 2018):
Hi guys, I had the same problem with IE. The solution I found is very easy. Just give a width and a height to the image.
function drawFloor() {
svg
.append("svg:image")
.attr("id", "image")
.attr("height", "386")
.attr("width", "1000")
.attr("xlink:href", "images/floor_1.png");
}
Easiest way to test it is to write the html code and delete width="1000" height="386". You`ll notice that IE will not render the image.