Is it possible to make a diagonal strip in CSS?

Is it possible to use only CSS (and without images) a background similar to blue in the next photo? If so, how?

enter image description here

script: https://jsfiddle.net/hd74keqq/

.striped-blue { background: #3777BB; padding: 20px;} .striped-blue p { color: #FFF; } 
+5
source share
1 answer

Maybe this will help you :)

CSS

 div { width: 100%; height:900px; background: repeating-linear-gradient( -55deg, #3777BB, #3777BB 1px, #3072B8 1px, #3072B8 6px ); } 

This is partially similar.

Demo

enter image description here

You can play with properties to suit your needs.

 div { width: 100%; height:900px; background: repeating-linear-gradient( -40deg, #3777BB, #3777BB 1px, #3072B8 1px, #3072B8 4.9px ); } 

Demo

enter image description here

Edit: Here you have more information about the repeating linear gradient.

The formal syntax is:

 repeating-linear-gradient( [ <angle> | to <side-or-corner> ,]? <color-stop> [, <color-stop>]+ ) 

Additional Information

+6
source

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


All Articles