Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Changing font colour of individual menu headings

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #43383
    CMonique
    Member

    Hi people!

    Is it possible to change the colour of the font in the menu so that each menu item (just the heading, not the drop down) is a different colour?

    If so, what is the code I would need to put into the css to make this happen?

    http://getyourswaggaback.com

    Thank you!

    #128171
    Paulie_D
    Member

    There are a few ways.

    The simplest is to assign a class to each top level list item.

    As these already exist for you; **’menu-item-26’** etc, you can just do something like

    .menu-item-26 {
    color: pick a color;
    }

    .menu-item-27 {
    color: pick another color;
    }

    etc.

    #128172
    CMonique
    Member

    #access ul {
    float:left;
    padding:0;
    margin:0;
    list-style:none;
    font-size:21px;
    font-weight:600;
    text-transform:uppercase;
    }

    This is the current code for that section, well that’s where I changed the font size and it worked.

    #128174
    Paulie_D
    Member

    Putting font styles in that section will change them for **everything** in your menu…and that’s not what you wanted.

    #128175
    CMonique
    Member

    Hey Paulie,

    Thanks for replying, this is the only place I found menu-item within the css

    #access a:hover,
    #access li.current_page_item > a,
    #access li.current-menu-item > a {
    background:#000;
    color:#fff;
    text-decoration:none;
    }

    Should I add the relevant numbers within this section? How will I assign numbers to the relevant heading?

    Thank you

    #128178
    Paulie_D
    Member

    You probably won’t find the suggested code in the existing CSS.

    You’ll have to add it yourself.

    #128181
    CMonique
    Member

    Ok, I tried to add what you suggested from menu-item-1 but it didn’t do anything. Do I need to add anything to the main index page php for it to pick it up?

    #128184
    Paulie_D
    Member

    Your top level menu items all have specific numbers….you can see them in the HTML in Web Inspector.

    Have you gone through and added classes for all of them?

    If you have then you might try commenting out (not deleting)

    #access a {
    color: #ffffff;
    }

    and seeing what happens.

    #128185
    CMonique
    Member

    Oh I’m sorry, I’ve never used Web Inspector. Is that a program I have to download or something I can do online?

    #128190
    CMonique
    Member

    Ok, I found all the menu item numbers and added them into the css. Hasn’t done anything. The code that you just put above do I need to include that for it to work?

    #128191
    CMonique
    Member

    #access a:hover,
    #access li.current_page_item > a,
    #access li.current-menu-item > a {
    colour:#fff
    background:#000;
    text-decoration:none;
    }

    .menu-item-25 {
    font-colour:#fff
    }

    .menu-item-27 {
    font-color:#154AEB;
    }

    .menu-item-26 {
    font-colour:#15EB79;
    }

    .menu-item-40 {
    font-colour:#15EB79;
    }

    .menu-item-39 {
    font-colour:#15EB79;
    }

    .menu-item-35 {
    font-colour:#15EB79;
    }

    .menu-item-36 {
    font-colour:#15EB79;
    }

    .menu-item-23 {
    font-colour:#15EB79;
    }

    #128192
    dfogge
    Participant

    @CMonique, web inspector is part of chrome’s developer tools. using it is an essential component of a web designer/developer’s workflow.

    check out this introduction here: http://webdesign.tutsplus.com/tutorials/workflow-tutorials/faster-htmlcss-workflow-with-chrome-developer-tools/

    #128193
    CMonique
    Member

    @dfogge, thank you, I don’t use google chrome.

    I have found the correct menu item numbers though, can you please look at this code and tell me where I’m going wrong?

    #access a:hover,
    #access li.current_page_item > a,
    #access li.current-menu-item > a {
    colour:#fff;
    background:#000;
    text-decoration:none;
    }

    .menu-item-25 {
    colour:#fff
    }

    .menu-item-27 {
    color:#154AEB;
    }

    .menu-item-26 {
    colour:#15EB79;
    }

    .menu-item-40 {
    colour:#15EB79;
    }

    .menu-item-39 {
    colour:#15EB79;
    }

    .menu-item-35 {
    colour:#15EB79;
    }

    .menu-item-36 {
    colour:#15EB79;
    }

    .menu-item-23 {
    colour:#15EB79;
    }

    Thank you

    #128194
    dfogge
    Participant

    you really should use chrome.

    i think the problem is you’re using the uk spelling of color in your code. try taking out the u’s. ;)

    #128195
    Paulie_D
    Member

    Yeah…when I say Web Inspector, I really mean the developer tools that are built into most browsers.

    In Chrome / Safari, you can just ‘right-click’ and ‘inspect element’.

    In IE just hit F12.

    In Firefox, I think you have to install the Firebug extension ( I know I did) . If there are native tools in FF, they are probably along the same lines.

    Oh…and definitely use Chrome as your default browser*.

    *fanboi

Viewing 15 posts - 1 through 15 (of 22 total)
  • The forum ‘CSS’ is closed to new topics and replies.