[英]Why doesn't my repeating linear gradient work in Safari even after trying -webkit-linear-gradient? It works perfectly in Chrome
Refer to this codepen.请参阅此代码笔。 Even the codepen code doesn't work in Safari but works in Chrome.
甚至 codepen 代码在 Safari 中也不起作用,但在 Chrome 中有效。
https://codepen.io/srbsingh3/pen/bGpgQoY https://codepen.io/srbsingh3/pen/bGpgQoY
div {
height: 400px;
margin-left: 200px;
background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 0 3px, transparent 3px 8px) 0/1px no-repeat,
linear-gradient(to bottom, #74ddb1 0 19px, transparent 19px 133px, #74ddb1 133px 152px, transparent 152px 100%) 0/1px no-repeat;
}
You use rgb
but pass parameters for rgba
;您使用
rgb
但为rgba
传递参数; you set your background size to 1px so it's tiny.您将背景大小设置为 1px,因此它很小。
Specifying rgba
and playing with position and size makes backgrounds in your pen visible in Safari on iOS.指定
rgba
并调整位置和大小可使您笔中的背景在 iOS 上的 Safari 中可见。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.