无法在Firefox中显示我的svg图像

无法在Firefox中显示我的svg图像

本文介绍了无法在Firefox中显示我的svg图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Firefox中显示我的svn图像...它在Safari和Chrome中正常运行(没有IE,因此尚未对其进行测试).

I can't get my svn-image displayed in Firefox... it works fine in Safari and Chrome (don't have IE, so haven't tested that yet).

它是在我的html中实现的;

It's implemented like this in my html;

img class ="logo1" src ="/images/logo6.svg"

img class="logo1" src="/images/logo6.svg"

logo1只是定位类.

Where logo1 is just a class for positioning.

我尝试使用google进行搜索,但是刚刚发现Firefox不支持sag,但是仍然有一些方法可以显示它.但是,所有解决方案的确很难理解. (我不是程序员!)

I've tried to google but have just found that sag isn't supported by Firefox, but nonetheless, there are ways to display it. All solutions has been really hard to understand though. (I'm not a programmer!)

有没有简单的方法可以做到这一点?

Are there any easy ways of doing this?

推荐答案

您没有在任何地方指定SVG的大小.在您的logo1类中,您指定100%,但可以享受100%的优惠? Chrome之所以能正常工作,是因为它默认使用的宽度是宽度不定"(默认为300px).但是Firefox使用父元素(<li>)宽度的100%,即0

You aren't specifying a size for your SVG anywhere. In your logo1 class, you specify 100%, but 100% off what? Chrome is working because it is defaulting to the "indeterminate sizing" default which is 300px width. But Firefox is using 100% of the width of the parent element (<li>), which is 0

在您的logo1类中指定实际宽度和/或高度,并且所有内容在FF中都可以正常工作.

Specify a real width and/or height in your logo1 class and everything should work fine in FF.

.logo1 {
    padding-top: 6px;
    width: 300px;
}

这篇关于无法在Firefox中显示我的svg图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 08:17