如何在palcedoler中放置图标

如何在H5的palceholder中设置一个图标?

使用FontAwesome可以很方便的实现 :

<input type="text" placeholder="&#xF002; 搜索" style="font-family:Arial, FontAwesome" />

其中:&#xF002; 为FontAwesome的字体编码,FontAwesome字体和字体编码可以从下面地址获得:

图标字体页面:

http://fontawesome.io/icons/

图标字体对应的十六进制编码页面:

http://fontawesome.io/cheatsheet/

猜你喜欢

转载自sheng.iteye.com/blog/2323640
今日推荐