Why background-repeat: no-repeat doesn't work

2019-03-01 11:13发布

I got stuck with a strange problem in Opera 12: I have an .svg image which is linked within my css code. When I resize to zoom-out the page where the image is displayed, Opera repeats the image as if I didn't use the "no-repeat" value in background-repeat. What am I missing?

Here is my css code:

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

I also tried this:

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

But it didn't work. Why opera does that?

1条回答
甜甜的少女心
2楼-- · 2019-03-01 11:25
.svgImg {
background: url("../img/img.svg") no-repeat;
height:100%;
width:100%;
}
查看更多
登录 后发表回答