使用css将渐变应用于颜色属性



我有一个带有html的社交媒体图标部分。

<li class="instagram pull-left"><a target="_blank" href="#"></a></li>

这就是它的风格。

.instagram a {
font-size: 22px;
display: inline-block!important;
text-align: center;
padding: 0;
background: #359BED !important;
color: #fff;
content: "f16d";
font-family: FontAwesome;
}

我想给背景白色和颜色在instagram中使用的渐变色。如何做到这一点?我试过了,但梯度是背景。不适用于instagram图标。任何人请帮忙。

试试这个,你可以根据你需要的在背景或颜色上应用它

.instagram
{
#Your code
display:inline-block;

/* Create the gradient. */
background-image: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); 

background-size: 100%;
/* Use the text as a mask for the background. */
/* This will show the gradient as a text color rather than element bg. */
-webkit-background-clip: text;
-webkit-text-fill-color: transparent; 
-moz-background-clip: text;
-moz-text-fill-color: transparent;
}

最新更新