Predefined classes

This example shows how to make Redactor arrange the specified classes for blocks or tags on startup.

Code

<style>
.rx-content .my-text {
    font-weight: bold;
}
.rx-content .and-second-class {
    color: green;
}
.rx-content .my-heading {
    font-style: italic;
}
.rx-content .my-image,
.rx-content .my-image img {
    border-radius: 12px;
}
</style>

<!-- element -->
<textarea id="entry">...</textarea>

<!-- call -->
<script>
let app = Redactor('#entry', {
    classes: {
        blocks: {
            'image': 'my-image',
            'heading': 'my-heading'
        },
        tags: {
            'p': 'my-text and-second-class'
        }
    }
});
</script>