Forums

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

Home Forums Design Hover on Button not Working

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #277186
    jubcheng
    Participant

    I have a button with a span which displays an icon.
    I can change the icon color, but not on hover.

    <button class="button" type="submit" value="Add To Cart"> <span class="ico ti-shopping-cart"></span></button>
    
    .ico {
        display: block;
        color: #fff;
    }
    
    .ico:hover {
        color: #ED1C24;
    }
    
    button {
        text-align: center;
        background: transparent;
        font-size: 50px;
        transition: all 0.3s ease 0s;
        margin: 50% 20px 0 0;
        border: none;
        width: auto;
        height: 50px;
    }
    

    What am I doing wrong ?

    #277187
    Beverleyh
    Participant

    Do you mean that you want to change the icon colour when you hover over the button? Try

    button:hover > .ico
    
    #277188
    jubcheng
    Participant

    Thank you very much, this worked like a charm.

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