简体   繁体   English

CSS-带有线性渐变的IE9问题背景图片(生成的SVG)无法正确重复

[英]CSS - IE9 issue background image with linear gradient (svg generated) does not repeat correctly

I tried to look for an answer on the web for this particular problem, but honestly don't really know what is going on here. 我试图在网上找到针对此特定问题的答案,但老实说,我真的不知道这是怎么回事。 I have created a fiddle here that shows the situation if you want to play around. 我在这里创建了一个小提琴用于显示您想玩的情况。

Here is the code that works in Chrome, Firefox and IE10+ 这是可在Chrome,Firefox和IE10 +中运行的代码

HTML code HTML代码

CSS code CSS代码

.low {
  width: 113px;
  height: 14px;
  background-color: red;
  background-image: linear-gradient(to right, white 50%, transparent 0);
  background-size: 4px;
  background-repeat: repeat;
}

I need a fallback for IE9. 我需要IE9的备用。 As you can see in the fiddle I already generated and svg image that works with IE9. 正如您在小提琴中看到的那样,我已经生成了可与IE9一起使用的svg图像。 At the moment the div is 113px x 14px and the background size is 4px 目前div为113px x 14px,背景尺寸为4px

The problem is, if the width is > 113, the stripes are not displayed anymore but instead it only shows the background color. 问题是,如果宽度> 113,则不再显示条纹,而是仅显示背景色。 If instead I set a higher height at some point the stripes are clearly displayed again. 相反,如果我在某个点设置了更高的高度,条纹将再次清晰显示。

How can I solve this ? 我该如何解决? What is it related to ? 有什么关系? Any help appreciated. 任何帮助表示赞赏。

I fixed doing this 我固定这样做

background-size: 4px 4px;

Now I am going to dig in the docs to find why. 现在,我将在文档中进行挖掘以查找原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM