Firefox is having trouble loading SVG files

For some reason, the SVG image is loading on all browsers except for Firefox.

I checked the DOM but couldn't find the code. Just to clarify, I am serving the page from Tomcat 9.0.34

<kendo-grid grid-options="gridOptions">

<img
    src="common/svg/Plain-HedvigLogo.svg" 
    height="150"
    width="100"/>
</kendo-grid>

The logo svg file that should be displayed in the browser is Plain-Logo.svg

   

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.6, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="0 0 459.2 602.7" style="enable-background:new 0 0 459.2 602.7;" class="add-new-placeholder" xml:space="preserve">
<style type="text/css">
    .st0{fill:#8496A1;}
    .st1{fill:#476273;}
    .st2{fill:#061A28;}
    .st3{fill:#082335;}
    .st4{fill:#FFA4B4;}
    .st5{fill:#FF778F;}
    .st6{fill:#FF4A6A;}
    .st7{fill:#C53953;}
    .st8{fill:#841F37;}
    .st9{fill:#922A3E;}
    .st10{fill:#0B2E44;}
</style>
<g>
    <path class="st0" d="M177.9,125.8h-51.7V74.1h48.1c2,0,3.6,1.6,3.6,3.6V125.8z"/>
</g>
<g>
    <path class="st1" d="125.8z"/>
    <rect x="126.2" y="125.8" class="st1" width="51.7" height="51.7"/>
</g>
... (all other paths and rectangles)
</svg>

Despite working on other browsers, the SVG image does not appear on Firefox.

I'm puzzled as to why it's not showing up on Firefox or even in the DOM code.

Answer №1

If your SVG code is being used as an IMG, you won't be able to find it in the DOM

 <img 
    src="common/svg/Plain-Logo.svg" 
    style="width:150px; height:100px;" />

To resolve this issue, try opening your SVG file directly with Firefox and consider the following:

  • Ensure the SVG file has a correct view-box
  • Check for any issues related to image location floating
  • Open the SVG file directly in Firefox for further inspection

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When adding an object to an array in AngularJS, it seems to trigger updates for

Currently, I am fetching data from a WebAPI and then storing it in an array called products, which is scoped. $scope.products In addition to the products array, I also have another scoped array named selectedFish. $scope.selectedFish = []; My objective ...

Tips on testing third party library functions in Angular unit testing

Currently, I'm in the process of testing Angular services using Karma and Jasmine. Within my services, I've implemented sprintf() from the sprintf-js module to generate strings. However, when attempting to test the service, an error is occurring ...

Problem with CSS dotted borders appearing as dashed in Chrome when applied to adjacent columns in a table

After testing the code on both Chrome and Firefox browsers, I noticed that they display the border differently. In Chrome, there is a dash in between adjacent cells while in Firefox, there are no dashes rendering. Can anyone suggest a solution to fix thi ...

Aligning container - property: inline-block;

Having trouble centering two divs that are set to "display: inline-block;" in your code? Removing the inline-block class centers them, but they end up stacking vertically instead of horizontally. See below for an example: #news { background-image: url ...

What's the most effective method for implementing a stylesheet through Javascript in a style switcher?

I've been tackling the challenge of creating a style switcher for my website. Through utilizing .append() and if and else statements, I managed to make it work successfully. Take a look at the code below: HTML <select name="active_style" id="lol" ...

Why does my <p> element in Bootstrap continue to elongate and push everything below it down when I minimize the window?

I've got a standard bootstrap layout set up. <div classs="row-fluid"> <div class="span12" style="background:black; padding:25px 0px;">content content</div> </div> <div class="span4 offset2"> <p>blah blah bl ...

Lengthen the space between each item on the list to enhance readability

Is there a way to adjust the line height between li tags? I attempted using height:100%, but it seems ineffective. Are my methods correct? Can anyone provide guidance? The following is the code snippet in question: <html xmlns="http://www.w3.org/1999 ...

the live binding feature fails to function properly once an append operation is executed

Could someone please explain to me why adding an even number of squares causes the bind event to stop working? $("#add").click(function(){ $("#container").append("<div class=\"square\">xxxxxx</div> ").bind("click",function(e) { ...

Adhesive Navigation Bar

Check out this link: JSFIDDLE $('.main-menu').addClass('fixed'); Why does the fixed element flicker when the fixed class is applied? ...

A Step-by-Step Guide on Adding Content After the Bootstrap Slider Using Absolute Position

Check out my project here: I'm currently working on a bootstrap carousel that has absolute positioning and a z-index of -1. However, I'm facing an issue where I can't figure out how to place a div right after the carousel. I've tried s ...

Unleashing the Power of Conditional HTML Attribute Insertion

What is the best way to add a conditional attribute in AngularJS? For instance, I am looking to only apply the multiple attribute to a <select> element if a certain binding in my component is set to true. If this binding is not present, then the mul ...

The <div> tag fails to comply with the Display: inline CSS property

I need help with a web development issue as I am new to this field. My problem is that I am trying to display three divs next to each other, but despite applying display:inline-block to them, they still appear stacked on top of each other instead of side b ...

What is the equivalent of jQuery's blur event in AngularJS?

I need to implement a functionality in AngularJS where any opened component is closed when clicking outside of it. Is there an existing Angular directive for handling blur events, or do I need to come up with a custom solution? ...

Switching the input of data from a string format to a date format

One of the components in my registration form requires the user to input their start date. I am currently utilizing a MEAN Framework, specifically AngularJs for the front end development. Progress so far: Initially, I attempted using the code snippet bel ...

The iPython terminal is not displaying properly due to a constrained screen width

When my iPython displays a long list, it appears as one tall column instead of utilizing the full width of the terminal screen. I have attempted to adjust the CSS in '.ipython/profile_default/static/custom/custom.css' by setting '.container ...

Why does the col-sm-* class affect the appearance on extra small screens?

For a current project, I have incorporated bootstrap into my design and have set up varying column widths for xs, sm, and md screens. Initially, I utilized col-xs-* and col-md-* to ensure the columns resized appropriately for xs, md, and lg screens. Howeve ...

Encountering an issue when adding SASS Compass Breakpoint to my development project

I'm having trouble integrating breakpoints into my web project. I have SASS, Compass, and breakpoint all installed and I've followed the installation instructions, but it seems to be causing errors. Can someone help me troubleshoot the issue? He ...

Troubleshooting a mapping problem with CSS elements

While building my website, I have successfully mapped the elements by ID for all alphabet letters except A. When clicking on the letter A, it does not go to the respective elements. Can anyone please help me find a solution? Visit this link for reference ...

Angular: encountering an issue with reading the property 'then' of undefined object

My app has a service in place to upload images to Amazon S3 after signing them with my backend using the Cordova file-transfer plugin. I trigger this service after capturing a picture with the Cordova camera plugin to upload the captured image to the S3 b ...

Items are overflowing the flex container, exceeding its boundaries

I've experimented with the width property, flex, flex-basis, and flex-shrink, but so far nothing seems to be working. I can't seem to pinpoint where the mistake lies in the code. I wanted to include the code snippet here, but it's throwing ...