Rajesh
Rajesh

Reputation: 27

Is it possible to generate gradient using css2?

Is it possible to generate gradient using css2?

Note:- Without background image

Upvotes: 0

Views: 3789

Answers (2)

Marcelo Assis
Marcelo Assis

Reputation: 5194

No. Using plain CSS, only in CSS3, but you may find this usefull:
http://www.colorzilla.com/gradient-editor/

It generates gradients compatible with lot of different browsers. You just have to paste the generated CSS to your sheets. This way you don't need to load images on your background.

Upvotes: 2

Edward Ruchevits
Edward Ruchevits

Reputation: 6696

No, but here is the best cross-browser approach:

background-color: #ccc; // If gradients are not supported by browser

background-image:         linear-gradient( bottom, #ccc 0%, #ddd 100% );
background-image:      -o-linear-gradient( bottom, #ccc 0%, #ddd 100% );
background-image:    -moz-linear-gradient( bottom, #ccc 0%, #ddd 100% );
background-image: -webkit-linear-gradient( bottom, #ccc 0%, #ddd 100% );
background-image:     -ms-linear-gradient( bottom, #ccc 0%, #ddd 100% );
background-image:        -webkit-gradient( linear, left bottom, left top, color-stop(0, #ccc), color-stop(1, #ddd) );

Upvotes: 1

Related Questions