css - 彩色网页字体

标签 css webfonts font-awesome

我需要创建类似彩色网络字体的东西。我有一个元素,我正在使用很棒的字体和自定义图标字体。

我的问题是我需要像彩色图标这样的东西:

enter image description here

是否可以创建这样的字体,还是我必须使用图像来代替?字体会很好,因为图标应该是可缩放的。

希望大家能帮帮我!

最佳答案

使用渐变

background: rgba(231,56,39,1);
background: -moz-linear-gradient(45deg, rgba(231,56,39,1) 0%, rgba(240,47,23,1) 29%, rgba(246,41,13,1) 48%, rgba(246,41,12,1) 49%, rgba(241,111,92,1) 50%, rgba(248,80,50,1) 100%);
background: -webkit-gradient(left bottom, right top, color-stop(0%, rgba(231,56,39,1)), color-stop(29%, rgba(240,47,23,1)), color-stop(48%, rgba(246,41,13,1)), color-stop(49%, rgba(246,41,12,1)), color-stop(50%, rgba(241,111,92,1)), color-stop(100%, rgba(248,80,50,1)));
background: -webkit-linear-gradient(45deg, rgba(231,56,39,1) 0%, rgba(240,47,23,1) 29%, rgba(246,41,13,1) 48%, rgba(246,41,12,1) 49%, rgba(241,111,92,1) 50%, rgba(248,80,50,1) 100%);
background: -o-linear-gradient(45deg, rgba(231,56,39,1) 0%, rgba(240,47,23,1) 29%, rgba(246,41,13,1) 48%, rgba(246,41,12,1) 49%, rgba(241,111,92,1) 50%, rgba(248,80,50,1) 100%);
background: -ms-linear-gradient(45deg, rgba(231,56,39,1) 0%, rgba(240,47,23,1) 29%, rgba(246,41,13,1) 48%, rgba(246,41,12,1) 49%, rgba(241,111,92,1) 50%, rgba(248,80,50,1) 100%);
background: linear-gradient(45deg, rgba(231,56,39,1) 0%, rgba(240,47,23,1) 29%, rgba(246,41,13,1) 48%, rgba(246,41,12,1) 49%, rgba(241,111,92,1) 50%, rgba(248,80,50,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e73827', endColorstr='#f85032', GradientType=1 );
height:100px;
width:100px;

并查看此链接 http://jsfiddle.net/bipin_kumar/37fnW/1/

关于css - 彩色网页字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20190075/

相关文章:

android - @font-face 不适用于 Chrome for Android

GIT 如何设置 .gitconfig 以将 *.woff 文件识别为二进制文件

CSS3 动画不适用于 chrome 或 safari

javascript - Bootstrap 侧边菜单 : Collapse, 在小屏幕上最小化

css - Kadwa 中的右箭头(Google 字体)太宽

vue.js - 在 Vue 中动态导入 fontawesome 图标

php - Laravel 6 - CSS 文件传输到公共(public)文件夹

css - 仅使用 CSS 创建 flex 的 div

javascript - 针对移动/低速连接进行优化 - 全背景视频

css - 在另一个域上托管的 Web 字体