课程表

Ext.js课程

工具箱
速查手册

Ext.js 正常主题字体

当前位置:免费教程 » JS/JS库/框架 » Ext.js

描述

当我们使用任何不是Triton主题的主题时,我们需要在我们的项目中显式地添加font-awesome样式表:

语法

在HTML页面中添加用于字体样式的CDN文件。

  1. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" />

现在添加类为:
iconCls:'fa fa-car'

下面是一个添加font-awesome类的简单示例

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet" />
  5. <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js"></script>
  6. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" />
  7. <script type="text/javascript">
  8. Ext.onReady(function() {
  9. Ext.create('Ext.container.Container', {
  10. renderTo : Ext.getBody(),
  11. layout : 'auto' ,
  12. width : 600,
  13. items : [{
  14. xtype : 'button',
  15. iconCls : 'fa fa-car',
  16. text : 'Browse Fil1e'
  17. },{
  18. xtype : 'button',
  19. iconCls : 'fa fa-file',
  20. text : 'Browse File3'
  21. },{
  22. xtype : 'button',
  23. iconCls : 'fa fa-home',
  24. text : 'Browse File4'
  25. },{
  26. xtype : 'button',
  27. iconCls : 'fa fa-folder',
  28. text : 'Browse File5'
  29. }]
  30. });
  31. });
  32. </script>
  33. </head>
  34. <body>
  35. <div id = "panel" > </div>
  36. </body>
  37. </html>

尝试一下

转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号