另一个线性渐变内的线性渐变

2023-12-02

我正在尝试在另一个线性渐变中创建线性渐变,这可能吗?下面的例子

background: linear-gradient(to right, #color1 50%, #color2 0%)

颜色 1 是

background: linear-gradient(#aa0507,#e0171e,#aa0507);

颜色 2 是

background: linear-gradient(#f4c05b,#fcd580,#f4c05b);

最终结果应该是这样的

enter image description here


只需调整background-position/background-size使用多个背景。基本上每个渐变都是半宽和全高。

body {
  margin:0;
  height:100vh;
  background: 
   linear-gradient(#aa0507,#e0171e,#aa0507) right/50% 100%,
   linear-gradient(#f4c05b,#fcd580,#f4c05b) left /52% 100%; /*we can make this a little bigger to avoid the blank space*/
  background-repeat:no-repeat;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

另一个线性渐变内的线性渐变 的相关文章

随机推荐