Skip to content
WJunction - Webmaster Forum

help about css linear-gradient

Status
Not open for further replies.

Black Tiger

Established Member
249
2011
13
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.

About the author

B
Established Member · Joined
249
Messages
13
Reactions
18
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom