css - 为什么在 Opera 12 中背景重复 : no-repeat doesn't work with . svg 图像?

标签 css svg opera background-repeat

我在 Opera 12 中遇到了一个奇怪的问题:我有一个 .svg 图像链接在我的 css 代码中。当我调整大小以缩小显示图像的页面时,Opera 重复图像,就好像我没有在 background-repeat 中使用“no-repeat”值一样。我错过了什么?

这是我的 CSS 代码:

.svgImg {
    background: url("../img/img.svg") no-repeat;
    height:100%;
    width:100%;
}

我也试过这个:

.svgImg {
     background: url("../img/img.svg");
     background-repeat:no-repeat;
     height:100%;
     width:100%;
 } 

但是没有用。 为什么 Opera 会那样做?

最佳答案

尝试:

background-repeat:no-repeat!important;

在 Firefox v.88 上为我工作

关于css - 为什么在 Opera 12 中背景重复 : no-repeat doesn't work with . svg 图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20819153/

相关文章:

javascript - 将可滚动的 div 聚焦到一个位置

html - HTML img 元素中的 iOS Safari SVG 不起作用?

javascript - Opera 中的 HTML 表单提交

css - HTML 获取两个 div 并排对齐,并且在调整浏览器大小时不换行

html - 如何仅在div的顶部和底部添加渐变边框

jquery - 我的 svg 多边形填充在悬停时没有改变颜色

html - Div 在 Chrome 和 Opera 中不可见

html - 如何在 Opera 中使用 css 居中 <img> html 标签?

html - Bootstrap 中容器和行之间的 div

html - Raphael JS : Cannot mask objects. 替代品?