I am using the following code block to format text:
'formats': {
'format_code': {
'block': 'pre',
'styles': {
'color': '#000000',
'backgroundColor': '#f0f0f0',
'fontFamily': 'monaco,consolas,courier new,monospace',
'fontSize': '1.0em',
'width': '80%',
'minHeight': '5.0em',
'maxHeight': '15.0em',
'overflow': 'auto',
'border': '1px solid #999999',
'padding': '1.0em'
}
}
This code block was given to me. Now I would like to change it to use a CSS class.
Can anyone advise me how to do this. I am not familiar with tinyMCE.
The CSS is almost identical. The camelCase properties are dash seperated in CSS and the font containing a space must be quoted.
I assume you want to add it to the drop down Styles in TinyMCE. If you want to add it to the Format drop-down then that requires a different configuration option.
If you want a new Style in the drop-down then you need to put the CSS class rule above in a
.cssfile and configure TinyMCE as follows: