Jump to:

5539 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » How to set the HTML editor width?

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2228 Views
  • inCharge
    Community Member
    102 Posts

    How to set the HTML editor width? Link to this post

    typography.css is used to make the styles the same in the HTML editor as the site itself, so it is more WYSIWYG.

    However, to make it completely WYSIWYG, the editor width should match the column width of the website, so the text wraps in the same place. How?

    In typograpgy.css, the editor width can be set with:

    .htmleditor {
       width: 321px;

    The HTML editor control incorporates the field name, so if there are multiple fields with different widths, they can be set with:

    #ContentLeft.htmleditor {
       width: 321px;
    #ContentRight.htmleditor {
       width: 900px;

    However, I can't get the editor to shrink below the width of the toolbar, or expand greater than the width of the page (e.g. with a scrollbar).

    Any ideas?


  • nakashu
    Community Member
    24 Posts

    Re: How to set the HTML editor width? Link to this post

    You probably got it sorted out already:
    but let the answer be here just for sake of other who got this problem

    In themes/yourtheme/css/editor.css

    add this:

    body.mceContentBody {
       background:#cccccc url(../images/content_back.png) repeat-y -15px 0; /* will change background color / can use image also*/
       width:660px;   /*set width to what you like the text wrap */

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.