How to add Css classes in TinyMCE editor Styles drop down through coding


Tags: css,tinymce

Problem :

I want to load some custom css files classes in TinyMCE editor's styles dropdown, how one can do that specially through ASP.NET? is there any feature available from which i can pass on the path of my css files which are on a specific path at runtime? and TinyMCE editor load its classes in its Styles dropdown menu?



Solution :

While I am not familiar with ASP myself. I have done something similar using PHP in the past.

Use ASP to load the css file you want, in the head of your html

<link rel="stylesheet" type="text/css" href="<?php echo $pathtocss; ?>/tinymce.css" />

Then use the theme_advanced_styles option to the classes you want to use. http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced_styles

Hope this sets you in the right direction


    CSS Howto..

    How to view Google Maps in “print” mode?

    How can I avoid using too many classes in CSS?

    CSS: How do I stop hover effects from pushing my text?

    How do you override “-moz-user-select: none;” on a child element?

    How to not change color of link on hover

    How to disable caching of static assets like .css and .js in JSF2?

    How do I style all anchor tags inside a certain div?

    How to make a small icon using css?

    How to make URL change upon clicking through AJAX loaded menu?

    How to prevent Ajax long-poll from reloading div in Chrome?

    Pure JavaScript - how to add class to a class? Or change style in class

    how to add embedded ruby in style tag

    How to make margin collapsing work with input type=button/submit?

    show div and execute CSS animation in separate div on “li hover”

    How do you solve this Chrome button border bug?

    How do I specify CSS classes for specific rows in a GridView?

    How do I make a table's columns fill the width not occupied by fixed-width columns?

    How to use GitHub's primer and octicons?

    how to align an 'a' element in html/css

    how to show limited text in css [closed]

    How to remove css class with some effect using jQuery?

    How can I stop an CSS animation from interfering with a CSS transform transition?

    How to insert background image on HTML Tag using css?

    How To Adjust CSS List On Hover Image

    How to have a DIV appear after you hover over an image/link/another div?

    How can I fill the remaining space when dealing with an inline ul?

    How to position two
  • 's within a nested
      ?
  • jQuery slideDown() moves everything below downwards. How to prevent this?

    CSS: How to set up border radius cross browser (only IE8 and IE9 missing ?)

    CSS how to make an element fade in and then fade out?