Support » Theme: GeneratePress » Main nav selected button: how to set its color in style.css

  • Resolved jimchicago

    (@jimchicago)


    The site I’m developing is at jimhinckley.com/dan/. In the main nav, I got the buttons to change to blue (#293078) when hovered over, by adding this to my child theme’s style.css:

    .main-navigation li:hover > a {background-color: #293078 !important;
    }

    But I’m having no luck getting any button to stay that color when selected. I tried adding this to style.css but it’s not working:

    .main-navigation li:active > a {background-color: #293078 !important;
    }

    Thanks in advance for your help.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    This file shows all of the CSS in the theme for the navigation: https://gist.github.com/generatepress/793804f553c25c70823c

    There’s also an addon for $5 that lets you manipulate the colors of the navigation.

    Let me know if you have any issues 🙂
    Tom

    Theme Author Tom

    (@edge22)

    Any luck with the above code?

    No, because I’m not sure which of those 12 style declarations to edit in order to change ONLY the background color of the SELECTED button. Could you clarify for me?

    And would those declarations be in the parent’s style.css (meaning I should copy it from there and then edit it in my child style.css)?

    Theme Author Tom

    (@edge22)

    The last 4 blocks deal with the currently selected items.

    I’ve added some comments to make it more clear: https://gist.github.com/generatepress/793804f553c25c70823c

    Theme Author Tom

    (@edge22)

    Was the above more clear?

    Theme Author Tom

    (@edge22)

    I’m going to go ahead and mark this as resolved as the code has been provided.

    Reply in here to re-open the thread if need be 🙂

    Hi, sorry for not replying last week. Yes, the comments you added on the github page definitely helped. I added the last four blocks of CSS there to my style.css and the button of the selected page’s button now stays its own color after being clicked:
    http://www.jimhinckley.com/dan/

    One other thing: Don’t know how I did this (first noticed it about a week ago), but the site’s main content area now extends further to the right than the header does. Any idea how I can get the main content area “back in line” with the header? THANKS!

    Theme Author Tom

    (@edge22)

    I’m not seeing your main content area extending further than the header – we you able to fix this perhaps?

    Ehhhh . . . wow, will you look at that? I guess I fixed it. And just like before, I don’t know how I did it! Earlier today I made some changes to the calculator in the right sidebar, I guess that did the trick. Thanks for taking a look at it.

    Theme Author Tom

    (@edge22)

    No problem! 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Main nav selected button: how to set its color in style.css’ is closed to new replies.