Color Change Of Only One Word In Menu Item

Discussion in 'CSS' started by surimaribo, Apr 16, 2014.

  1. #1
    Hello,

    Lets say that i have a wordpress menu item called "Royal Bank "
    and now want to change the color of only the word "Bank"
    how do i go about changing that
    example: Royal Bank
     
    Solved! View solution.
    surimaribo, Apr 16, 2014 IP
  2. #2
    U can do it with CSS. I need the link to your website in order to tell you exactely how.
     
    Jedineka, Apr 16, 2014 IP
  3. surimaribo

    surimaribo Well-Known Member

    Messages:
    457
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Jedineka helped me solve this issue via pm
    i basically had to do this



    <span class="red">Bank</span>

    Add to your CSS at the bottom :


    .red { color: #900; }

    For the color u can change #900 to whatever colour u need.
     
    surimaribo, Apr 16, 2014 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    And if someone decides the word should be green? Or, italic in the inherited color? It is a poor practice to use a presentational token. Better, depending on structure,
    #nav span {
      color: red;
      }
    Code (markup):
    cheers,

    gary
     
    kk5st, Apr 16, 2014 IP
    deathshadow, wiicker95 and surimaribo like this.
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Pretty much what Gary said. IF you REALLY need a class on it, and can't find a REASON to say WHY it's "red", it probably shouldn't be. What makes it so special? WHY are you doing it? If you can't answer that in a word or two, you probably shouldn't be styling the element much less putting a class on it!

    Saying nonsense like 'red', 'center', 'column', or the even DUMBER idiocy of framework crap like "grid_2" or "width_6" is so presentational, you might as well go back to using FONT and CENTER tags like it's still 1997! Of course, that's why the whole "OOCSS" idiocy is such a steaming pile of manure, we need to go out and buy bibs for all the people who use it to catch the drool.
     
    deathshadow, Apr 17, 2014 IP