Mike Vierwind
Mike Vierwind

Reputation: 1520

Make background with css3

How can i make this background with css3? Image

I want to repeat it and want not use a image.

thanks for help

Upvotes: 1

Views: 114

Answers (2)

Matijs
Matijs

Reputation: 3148

I suggest you have a look at http://lea.verou.me/css3patterns/ for this

Having said that, images are always going to be faster. Beware of not using css gradients just for the sake of using css gradients.

Upvotes: 0

Kyle
Kyle

Reputation: 67194

You can do this using CSS3 gradients:

background: -moz-linear-gradient(top, #ffffff 0%, #ffffff 49%, #eaa82c 50%, #eaa82c 80%, #bc2020 81%, #bc2020 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(49%,#ffffff), color-stop(50%,#eaa82c), color-stop(80%,#eaa82c), color-stop(81%,#bc2020), color-stop(100%,#bc2020)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#ffffff 49%,#eaa82c 50%,#eaa82c 80%,#bc2020 81%,#bc2020 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#ffffff 49%,#eaa82c 50%,#eaa82c 80%,#bc2020 81%,#bc2020 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#ffffff 49%,#eaa82c 50%,#eaa82c 80%,#bc2020 81%,#bc2020 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#ffffff 49%,#eaa82c 50%,#eaa82c 80%,#bc2020 81%,#bc2020 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#bc2020',GradientType=0 ); /* IE6-9 */
}

http://jsfiddle.net/gDJtD/

Upvotes: 3

Related Questions