CSS3 gradient rendering issues from transparent to white

前端 未结 3 1858
再見小時候
再見小時候 2020-12-09 01:00

I am having issues with cross browser rendering of CSS3 gradients. This is happening when I am trying to create a gradient from transparent colour to white.

The file

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 01:44

    The trick with a color besides white (and with white actually) is to rgba the actual color that is fading.

    background-image: linear-gradient(to right, 
      rgba(111,174,249, 0) 0%,
      rgba(111,174,249, 0) 80%,
      rgb (111,174,249)    100%);
    

    In case the color being used is hex (like #6faef9) use a hex to rgba converter to convert the color.

提交回复
热议问题