Home /css /CSS Gradient an Easy One Liner /

CSS Gradient an Easy One Liner

2:17 am, April 23, 2017

Original Post Date: 3:19 am, November 25, 2014

Want to just add a gradient background to a div? Try this one:

background: linear-gradient(red, blue);

or you can use hex colours

background: linear-gradient(#FFFFFF, #000000);

Thats it! works in the latest version of chrome and firefox (and even IE!, but you will probably need the latest version.). I have not tested it in other browsers