help about css linear-gradient

Status
Not open for further replies.

Black Tiger

Active Member
249
2011
13
0
Code:
background: linear-gradient(to bottom, #2681CF 0%, #1966A9 100%) repeat scroll 0 0 transparent;
background:-moz-linear-gradient(to bottom, #2681CF 0%, #1966A9 100%) repeat scroll 0 0 transparent;
 background:-webkit-linear-gradient(to bottom, #2681CF 0%, #1966A9 100%) repeat scroll 0 0 transparent;
    background:-khtml-linear-gradient(to bottom, #2681CF 0%, #1966A9 100%) repeat scroll 0 0 transparent;

use these code show fine on firefox and IE but not show on google chrome

help me please
 
2 comments
He already applied webkit prefix. The problem is that webkit doesn't accepts to syntax atm (eg: to bottom), you need to specify from, like top. However Firefox renders that code pretty well.

This code should work out:
PHP:
    background: linear-gradient(to bottom, #2681CF 0%, #1966A9 100%) repeat scroll 0 0 transparent;
    background: -moz-linear-gradient(top, #2681CF 0%, #1966A9 100%) repeat scroll 0 0 transparent;
    background: -o-linear-gradient(top, #2681CF 0%, #1966A9 100%) repeat scroll 0 0 transparent;
    background: -webkit-gradient(linear, left top, left bottom, from(#2681CF 0%), to(#1966A9 100%)) repeat scroll 0 0 transparent;
    background: -webkit-linear-gradient(top, #2681CF 0%, #1966A9 100%) repeat scroll 0 0 transparent;
Note that there are 2 properties for webkit based browsers support. -webkit-linear-gradient is the new syntax which is similar to firefox one. -webkit-gradient is for old browsers like Safari (below version 4) and ancestors of chrome.
 
Status
Not open for further replies.
Back
Top