Yeah I got this working on my own sites. It doesn't automatically add the class but it puts an entry in the formats drop down. Once you've put the link in you'll need to select the link and the you should be able select that option in the format drop down.
cutsom CSS on <a> tags
Hello there !
It'sdriving me crazy so i'm asking for help here !
I'm trying to add custom CSS on tags in RTE. I have a CSS class called "
button
" wich applies a classic "btn btn-primary
". But all I manage to have is something like this :the
<span>
thing is really anoying so, is there any way to apply the class directly in the<a>
tag like good old <`a href="" class="btn btn-primary">?Thanks a lot ! Jo
Hi Fant0hm
There is a way to do this, however it will make the style available to all of your rich text boxes that have the formats drop down enabled.
This guide here should help you set up the style. It was written for Umbraco 7, but I think it still works with Umbraco 8 but I've not tested it.
https://www.justnik.me/blog/umbraco-rte-styles-another-way
Thanks
Nik
Hi Nik, thanks for the link. Just tried the basic code it gives us, but nothing happens.
If I go to any RTE in my website then add a link, it does nothing
Didi you manage to make it work once on your own? Do I have to use a new RTE to have the changes applied or something?
Hey Fant0hm,
Yeah I got this working on my own sites. It doesn't automatically add the class but it puts an entry in the formats drop down. Once you've put the link in you'll need to select the link and the you should be able select that option in the format drop down.
Nik
Hey Nik, sorry for the delay.
Thanks for the tip ! I did not noticed that it added a new style in the format dropdown ! Ahah
It's all good, everything working fine!
Thanks a lot for your help!
Fant0hm
is working on a reply...