WordPress.org

Ready to get started?Download WordPress

Forums

changing color of only a couple words in a post (5 posts)

  1. stikguy
    Member
    Posted 8 years ago #

    Hey Guys,
    I want to be able to change the color of just a few words in a post as I am writing it. I'm not far enough along to create a tag and all that stuff. What code would I surround the text with to change its color?
    thanks,
    stikguy

  2. etoile
    Member
    Posted 8 years ago #

    The best way to do that is:
    <span style="color: yourcolorhere;">your text here</span>

  3. stikguy
    Member
    Posted 8 years ago #

    etoile,
    Thanks for the quick reply. Got it.
    Stikguy

  4. vavroom
    Member
    Posted 8 years ago #

    Similarly to what etoile suggests, I'd do:
    <span class="yourclassname">your text here</span>
    Then I'd make an entry in your style.css to style the span with the colour you desire.

    This has the added advantage that you can change the colour and styling of the spans over your entire site by making a simple change in your css, rather than having hard coded styling in each post/pages.

  5. dijhili
    Member
    Posted 7 years ago #

    you would think by now someone would have created a plugin that would allow you to change colors of the text in a post on the fly, without the use of HTML...

Topic Closed

This topic has been closed to new replies.

About this Topic