Creating transparent text to show gradient color of underlying div

前端 未结 6 1090
悲&欢浪女
悲&欢浪女 2021-01-13 16:53

I am trying to create gradient text with plain HTML and CSS. Something like the text below

Check the FIDDLE. It is self explanatory.

I know how to achieve th

6条回答
  •  粉色の甜心
    2021-01-13 17:36

    There are 2 thing to be covered in IE

    For IE10+:

    background: -ms-linear-gradient(top, #1e5799 0%,#207cca 27%,#2989d8 50%,#207cca 79%,#7db9e8 100%); /* IE10+ */
    background: linear-gradient(to bottom, #1e5799 0%,#207cca 27%,#2989d8 50%,#207cca 79%,#7db9e8 100%); /* W3C */
    

    For IE6-IE9:

    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */
    

    I think it will be easy for you to replace the color codes. I would also suggest you to take a look at ColorZilla for generating the CSS Gradient.

提交回复
热议问题