简体   繁体   English

如何使用 ZC7A62​​8CBA22E28EB17B5F5C6AE2A266AZ 线性渐变为背景中的线条赋予角度

[英]How to give angle to the lines in the background using css linear gradient

I wanted to design a pattern of mesh but with angles in the background like the photo i attached.我想设计一个网格图案,但背景中有角度,就像我附上的照片一样。 but it didn't work.但它没有用。 pls help me resolving this problem.请帮我解决这个问题。 this is image of what i want这是我想要的图像

here is my code这是我的代码

        .stripped {
        height: 500px;
        opacity: 0.8;
        background-image: linear-gradient(to top,#ababab 2px, transparent 2px), linear-gradient(to right, #ababab 2px, rgb(161, 8, 8) 2px);
        background-size: 100px 100px;
    }

You can rotate the element about the x axis and set a perspective value (where the observer is standing).您可以围绕 x 轴旋转元素并设置透视值(观察者站立的位置)。

 .container { transform-style: preserve-3d; perspective: 800px; }.stripped { height: 500px; opacity: 0.8; background-image: linear-gradient(to top, #ababab 2px, transparent 2px), linear-gradient(to right, #ababab 2px, rgb(161, 8, 8) 2px); background-size: 100px 100px; transform: rotate3d(1, 0, 0, 45deg); }
 <div class="container"> <div class="stripped"></div> </div>

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

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