• Home
  • Quick Start
  • Get Started
  • Infrastructure
  • General Web Instruction
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
UT Shield
College of Fine Arts Drupal Instructions
  • Home
  • Quick Start
    • Editor Access, Workflow, Approvals & Roles
    • FAQs and Recommended Workflows
  • Get Started
    • The Dashboard
    • Content Types and Layout
      • Categories, Taxonomy and Terms
      • Landing Pages
      • Layout Builder Sections & Blocks
        • Listing Blocks
        • Reusable Blocks
        • Main Navigation Block
        • Quick Links Block
        • Featured Content Blocks
        • Ambient Video Block
      • Announcement Banner
      • Events
        • University Calendar Instructions
        • Pre-Filtered Link
    • Create, Publish, Edit, Unpublish, Delete, Archive
      • Content States: Published, Unpublished & Draft
      • Create Content
      • Edit Existing Content
      • Publishing Content
      • Delete, Unpublish, Archive
      • Revisions
      • Clone
    • Menus, Paths & Links
      • Editing Menus
      • URL Path Address
      • Create a Link
        • Linking to Another Spot on the Page
        • Pre-Filtered Link
        • Non-Visible Context and Visually Hidden
      • Secondary Menu
      • Duplicate Menu Label, URL or Title Issues
    • Rich Text Editor
      • Create a Link
        • Linking to Another Spot on the Page
        • Pre-Filtered Link
        • Non-Visible Context and Visually Hidden
      • Insert an Image
        • Left & Right Image Alignment
      • Insert a Document
      • Multimedia and Embeddable Content
      • Adding Hide/Reveal Elements
      • Tabular Data in Tables
      • Simple 2 Column Description List
      • Responsive Word Wrapping & Hyphenation
      • HTML Source
        • Hide on Desktop or Hide on Mobile
    • Media (Images, Documents & Videos) Management
      • Insert an Image
      • Insert a Document
      • Multimedia and Embeddable Content
  • Infrastructure
    • Site Search
    • Caching
    • Community Factors
    • Database vs. Code
    • Test Site
    • Release Cycles
  • General Web Instruction

ckeditor.styles.js

Last Updated January 2016

The ckeditor.styles.js controls what options are in the Styles drop-down button in the Rich Text editor.

We’re customizing it to provide a few additional stylistic options for the content owners. Your designs should provide CSS styles for the following selections that will be in the Styles drop-down:

Image on Left – float image to the left and add border, padding and margins as desired.
Image on Right – float image to the right and add border, padding and margins as desired.
Clear Floated Elements: clear the floated content above. Can be applied to any element.
Bigger Text – make the text larger using a < span > tag with the class “bigger”.
Fine Print – make the text smaller, using the < small > tag.
Cited Work – cited works (appears as italicized text), using the < cite > tag.
Caption – We’ve been looking at the option of using figure and figcaption, but it doesn’t look promising at this time. For now we imagine the content editor will select text associated with images to apply this styling which will insert a < span > tag with the class “caption”.

Please be aware of all CSS options required for the site.

Create the ckeditor.styles.js file and save it in your theme directory.

Code for ckeditor.styles.js

if (typeof(CKEDITOR) !== 'undefined') {
    CKEDITOR.addStylesSet('drupal', [
       
        /* Classes */
        {
            name: 'Clear Floated Elements',
            element: 'span',
            attributes: {
                'class': 'clear-float'  /* css ex. .clear-float{clear:both;display:block} */
            }
        },

        /* Elements */
        {
            name: 'Bigger Text',
            element: 'span',
            attributes: {
                'class': 'bigger' /* style to your needs */
            }
            
        },
        {
            name: 'Fine Print',
            element: 'small',
        },
        {
            name: 'Cited Work',
            element: 'cite'
        },

        /* Styles- floating images */
        {
            name: 'Image on Left',
            element: 'img',
            attributes: {
                'class': 'float-left'       /* css ex. .float-left{float:left;margin-right:1em;} */
            }
        },
        {
            name: 'Image on Right',
            element: 'img',
            attributes: {
                'class': 'float-right'  /* css ex. .float-right{float:right;margin-left:1em;} */
            }
         }
 ]);
}
 

Primary Sidebar

Open Office / Co-Working Sessions

Second Monday of the month:
11 a.m. – 12:30 p.m.

Fourth Thursday of the month:
2 p.m. – 3:30 p.m.

Email us for the Zoom link.

College of Fine Arts Web Instruction
Subscribe to our email list to receive periodic tips and resources for generating great digital content

Contact Us

The COFA Web team can be reached by emailing us at cofawebmaster@austin.utexas.edu

UT Home | Emergency Information | Site Policies | Web Accessibility | Web Privacy | Adobe Reader

© The University of Texas at Austin 2025