How to make a “true” CSS carbon fiber background

True carbon fiber is a series of interconnected gray fibers, they look like gray-colored woven sheets. Does anyone know how to create such a template in CSS, please?

examples from Lea Verou are not true carbon fiber, hope you know what true carbon fiber is!

Ultimately, I want to achieve something similar to this background here .

Having additional gradients superimposed on a carbon fiber background.

+4
source share
1 answer

, , - ( ), , Lea Verou. linear-gradient , , -.

.. - , , , . ( ) CSS.

body {
  background-color: rgb(32, 32, 32);
  background-image: linear-gradient(45deg, black 25%, transparent 25%, transparent 75%, black 75%, black), linear-gradient(45deg, black 25%, transparent 25%, transparent 75%, black 75%, black), linear-gradient(to bottom, rgb(8, 8, 8), rgb(32, 32, 32));
  background-size: 10px 10px, 10px 10px, 10px 5px;
  background-position: 0px 0px, 5px 5px, 0px 0px;
}
Hide result

- ( , ), , .

body {
  background-color: rgb(32, 32, 32);
  background-image: linear-gradient(to right, rgba(0,0,0,1), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 80%, rgba(0,0,0,1)), linear-gradient(45deg, black 25%, transparent 25%, transparent 75%, black 75%, black), linear-gradient(45deg, black 25%, transparent 25%, transparent 75%, black 75%, black), linear-gradient(to bottom, rgb(8, 8, 8), rgb(32, 32, 32));
  background-size: 100% 100%, 10px 10px, 10px 10px, 10px 5px;
  background-position: 0px 0px, 0px 0px, 5px 5px, 0px 0px;
}
Hide result
+10

Source: https://habr.com/ru/post/1622428/


All Articles