1. css效果
/*!* Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)*/.fa-glass:before {content:"\f000"}
.fa-music:before {content:"\f001"}
.fa-search:before {content:"\f002"}
.fa-envelope-o:before {content:"\f003"}
.fa-heart:before {content:"\f004"}
2. 使用py批量转换为html格式
# part I 转化一个
def toCss(str2):#str2='.fa-glass:before {content:"\f000"}'import re arr = re.split(':', str2)[0]arr=arr[1:]return "<i class='fa %s' title='%s'></i>" %(arr, arr)# test
toCss('.fa-film:before {content:"\f008"}')
## "<i class='fa fa-film' title='fa-film'></i>"# part II 转换全部
fr = open("css.txt", 'r')
fw = open("index.html", 'w')
header="""
<meta charset="utf-8">
<link rel="stylesheet" href="/static/css/font-awesome.min.css"><style>
i{margin:10px;}
</style>
"""
fw.write(header + "\n")i=0
while True:i +=1if i>10:#breakpasslineR = fr.readline()if not lineR:break;line = lineR.strip()css = toCss(line)#print(i, line, css)fw.write(css + "\n")
fr.close()
fw.close()print("end", i)
# 586 个小图标
3.效果图
可以目测效果图,然后鼠标右击查看样式代码。