Tuesday, June 4, 2024
 Popular · Latest · Hot · Upcoming
160
rated 0 times [  165] [ 5]  / answers: 1 / hits: 31210  / 10 Years ago, thu, august 7, 2014, 12:00:00

I'm trying to add a Font-Awsome icon to a button I added to tinyMCE thus:



 ed.addButton('youtube', {
title: 'Add Video' ,
icon: 'icon-youtube',
onclick: function () {
//do stuff here...
}


using an image like the docs suggest was not acceptable but for some reason I am not able to make this work. any ideas?


More From » angularjs

 Answers
74

this CSS based solution seems to work nicely:



 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;
}


it is based on matt-royal's answer on this stack exchange wordpress thread


[#69868] Wednesday, August 6, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
samir

Total Points: 145
Total Questions: 90
Total Answers: 89

Location: Tokelau
Member since Sun, May 7, 2023
1 Year ago
;