We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29743
    • 2 Posts
    I am fairly new to creating and managing a website. My only prior experience has been with wordpress. I had someone build a web page for me and they used Modx. I am trying to edit the text on my homepage and the problem I am having is trying to change the color of the text. For example, I click to highlight the word I want to change. I select the tool from the tool bar to change the color. Once I click update it changes the whole paragraph to the selected color. huh Oddly enough, I can change anything but the color and it works correctly. I know this is something simple and has probably been asked before, but I couldn’t find the answer by searching. Thank you for your help! grin
      • 3749
      • 24,544 Posts
      It may be a bug in TinyMCE or there may be a configuration setting that would change it, but I don’t know of one.

      It’s why many of us work in raw HTML rather than using a Rich Text Editor (TinyMCE in your case). smiley

      If you color a paragraph in TinyMCE, and then turn off the RTE (uncheck the Rich Text box on the "Page Settings" tab and save), you should be able to find the tags that turn the color on and off at the beginning and end of the paragraph. Note the color code (something like: #e42a1a;). Highlight the color style (style="color: #e42a1a;"), cut it, and copy it into a span tag around the word:

      <span style="color: #e42a1a;">ColoredWord</span>


      If there’s a name for the color you want, you can do it this way and skip the step above:

      <span style="color:red">ColoredWord</span>


      You could also highlight the word’s background like this:

      <span style="background-color:blue">Word</span>


      You’ll want to leave a space before and after the span.


      If you have trouble, turn off the RTE and paste the paragraph code with all the tags into a reply here and we’ll show you what you need to do.

      If you’re going to do any significant amount of work on web sites, it’s really worth learning HTML and CSS so you can get things the way you want them without trusting a Rich Text Editor to do the right thing. smiley

      BTW, the correct way to do this is to use CSS. In that case, you’d have this

      <span class="highlightword">ColoredWord</span>


      Then in your CSS file, you’d have:

      .highlightword {
       color: red
      }


      That way, you could change the color, background color, size, font weight, and/or font of all the highlighted words on your web site just by changing that section of the CSS file.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting