我正在为我添加到tinyMCE的按钮添加一个Font-Awsome图标:
- ed.addButton('youtube',{
- title: 'Add Video',icon: 'icon-youtube',onclick: function () {
- //do stuff here...
- }
使用像文档建议的图像是不可接受的,但由于某些原因我无法做到这一点.有任何想法吗?
解决方法
这个基于CSS的解决方案似乎很好地工作:
- i.mce-i-[FONT-AWESOME-CLASSNAME]:before { // FONT-AWESOME-CLASSNAME e.g. "icon-youtube"
- content: "[FONT-AWESOME-CONTENT]"; // FONT-AWESOME-CONTENT e.g. "\f166"
- font-family: FontAwesome;
- font-style: normal;
- font-weight: normal;
- text-decoration: inherit;
- color: #000;
- font-size: 1.5em;
- padding-right: 0.5em;
- position: absolute;
- top: 15%;
- left: 0;
- }