CKEditor Textarea Width/Margin Customizations

CKEditor is hands down the best WYSIWYG editor for Drupal. It has the most features and the best integration. Implementing it can be tricky. Check out this link for a summary of all the posts that I have written about making this excellent text/HTML editor work for you.

One of the cutomizations that I wanted to make was the reclamation of wasted space in the margins of the editor. In one of my sites, I had a textarea that is rather narrow due to the nature of the layout. And it seems that the defined margins of CKEditor are pretty narrow wheen it comes down to brass tacks. I began to search through the config.js file, looking for the area where I could adjust the margins or the indentation. But what I actually needed was a simple CSS change.

.cke_editable {/*reclaims space on the research textarea from the ckeditor default*/
cursor: text;
margin-left: -50px;
margin-right: -43px;

This is the overriden selector that I used to make this happen for me. It ended up being a lot easier than I thought it would be.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: