WordPress.org

Ready to get started?Download WordPress

Forums

Pinboard
CSS code for button hover not working (5 posts)

  1. BingoPajama
    Member
    Posted 1 year ago #

    Hi there.

    I'm having a problem with some CSS code. The code is meant to make the hover colours on the main menu alternate. But so far, it hasn't worked as expected.

    The first section works fine:

    #access li a:hover

    {
    background-color:yellow;
    }

    ...but this next piece of code has zero effect.

    #access li a:hover:first-child:hover {
    background-color:red;
    }

    #access li a:hover:nth-child:hover {
    background-color:green;
    }

    #access li a:hover:nth-child:hover {
    background-color:yellow;
    }

    ...I've tried some variations of it, all to no avail.

    If anybody could tell me what I'm doing wrong I'd be most grateful :).

    I'm relatively new to programming CSS. I still don't have a clear model of the interplay between the page, HTML and the style sheet.

    I can usually hack something together from what I know and from what I can glean from online sources around the web and friends.

    If someone could string together some code that does what I want it to and explain it for me, that would be superb.

    The site is here - http://wildhoneysoundsystem.co.uk/
    Thanks for your time

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Are you using a child theme?

  3. BingoPajama
    Member
    Posted 1 year ago #

    No, I'm entering the code in the custom CSS section that's built into the theme. Its in the Layout section.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Try using Firefox with the Firebug add-on to pin down the CSS you need to amend. Or use whatever developer tool is available in your web browser.

  5. BingoPajama
    Member
    Posted 1 year ago #

    I used Chrome to do exactly that. I thought I HAD pinned it down... and to some extent, I did: the first section works fine. The second, the bit that I really needed to function, didn't.

    I think its my understanding of CSS and how it fits into the architecture of the theme that's lacking. I hoped that somebody may be able to tell me where I've gone wrong.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic