Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make a diagonal pinstripe like this in CSS?

Tags:

css

Is it possible using only CSS (and no images) a background like the blue one in the following photo? If so, how?

enter image description here

fiddle: https://jsfiddle.net/hd74keqq/

.striped-blue { background: #3777BB; padding: 20px;}
  .striped-blue p { color: #FFF; }
like image 268
Subpar Web Dev Avatar asked Jan 29 '16 01:01

Subpar Web Dev


1 Answers

Maybe its help you :)

CSS:

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

It is partially similar.

Demo

enter image description here

You can play with the properties to accommodate your need.

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 of repeating-linear-gradient

Formal Syntax:

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

More info

like image 119
Ferrmolina Avatar answered Nov 15 '22 07:11

Ferrmolina