WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to add background color on part of page contents? (4 posts)

  1. cfm168
    Member
    Posted 2 years ago #

    I tried to use Ultimate TinMCE to add backgound color for just a part of page contents, but I can't. Only can add text highlight. Please advise how to add by Ultimate TinMCE or any other suggestions.

    Thanks!

  2. creekdweller
    Member
    Posted 2 years ago #

    Someone else may have an easier suggestion, but here's what occurs to me. You can set up a shortcode that will do the trick either with inline css or by assigning a class to the relevant portion of the page contents and adding a background to the class in styles.css. Ultimate TinyMCE will display that item in the shortcode dropdown list (assuming, of course, that you've configured UTMCE to display the shortcode dropdown). Then you'd be able to select a chunk of text for which you want a different background and then choose the relevant shortcode from the dropdown to make the background appear. A good explanation of how to set up a shortcode appears here:

    http://wp.smashingmagazine.com/2012/05/01/wordpress-shortcodes-complete-guide/

  3. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    You can easily do that using CSS and ID or class attributes in the part of the page you want to change the color of. If you want more specific help, post a link to your site.

  4. cfm168
    Member
    Posted 2 years ago #

    Resolved by following codes. It is much easier. I'm a baby. Thank you so much WPyogi and creekdweller.
    <head>
    <style type="text/css">
    p
    {
    background-color:#FFFFE0;
    }
    </style>
    </head>

    <body>
    <p>
    Text here.
    </p>
    </body>

Topic Closed

This topic has been closed to new replies.

About this Topic