• Hi there,

    I am not sure if it is possible, but I thought I’d ask.

    I have a self-hosted WP site and I would like the site title to display text in two different colors.

    Googling and searching the forums haven’t yielded any answers other than to show me how to use CSS to change the color of all words in the title.

    I’d really appreciate any suggestions…

    Thanks

    Dunstan

    • This topic was modified 8 years, 1 month ago by dunst4n.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    UNfortunately, CSS does not have an ::nth-word pseduo element, so you can’t easily do this in CSS. If you google about, you can find several jQuery scripts that do it, albeit a bit inelegantly.

    Thread Starter dunst4n

    (@dunst4n)

    Thanks Steve… you’ve just confirmed what I thought. I’ll give it a go with jQuery. Thanks

    you may use image rather than text.

    Thread Starter dunst4n

    (@dunst4n)

    Yeah I tried that, but I’m having issues with how the images display on different devices… and honestly I don’t feel like creating and optimizing different images for the 4 or 5 most popular devices. Plain text would be SOOO much easier.

    Thanks anyway for your answer.

    Cheers
    Dunstan

    Thread Starter dunst4n

    (@dunst4n)

    Maybe this is a dumb suggestion, but is there a way to place each word in the title in it’s own <div> or <span> or something? That would enable different class assignment and hence different colors, wouldn’t it?

    I mean I know this isn’t a css best practice, but it seams to me to be less of a hassle than jQuery…

    Thanks guys

    Dunstan

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Multiple colors for title text’ is closed to new replies.