Linear gradient in Chrome and Safari browsers

后端 未结 5 777
梦谈多话
梦谈多话 2020-12-28 19:27

I am having trouble showing a linear gradient in Safari and Chrome. In Firefox it shows up fine.

I am trying:



        
5条回答
  •  庸人自扰
    2020-12-28 19:49

    For Cross browser compatibility try the following

    background-color: #9e9e9e; /* fallback color if gradients are not supported */
    background-image: -webkit-linear-gradient(bottom, rgb(213,12,18), #9e9e9e 40%); /* For Chrome 25 and Safari 6, iOS 6.1, Android 4.3 */
    background-image:    -moz-linear-gradient(to bottom, #9e9e9e 60%, #454545 100%); /* For Firefox (3.6 to 15) */
    background-image:      -o-linear-gradient(to bottom, #9e9e9e 60%, #454545 100%); /* For old Opera (11.1 to 12.0) */ 
    background-image:         linear-gradient(to bottom, #9e9e9e 60%, #454545 100%); /* Standard syntax; must be last */
    

提交回复
热议问题