Navigation hyperlinks only work when mouse is on the text

后端 未结 2 727
死守一世寂寞
死守一世寂寞 2021-01-28 11:49

My navigation button looks different when I mouse over, as it should, though the pointer cursor does not appear until I mouse over the text which is not what I want. I want the

相关标签:
2条回答
  • 2021-01-28 12:00

    You should apply these styles to .navButton a instead as those are the hyperlinks (but also keep display: inline-block on .navButton for their inline arrangement):

    .navButton {
        display: inline-block;
    }
    
    .navButton a {
        /* ... */
    
        display: block; /* Replace inline-block with block */
    
        /* ... */
    }
    
    .navButton a:hover {
        /* ... */
    }
    
    .navButton a:active {
        /* ... */
    }
    
    0 讨论(0)
  • 2021-01-28 12:10

    Just add cursor:pointer to your .navButton:hover class Here's an updated fiddle: http://jsfiddle.net/mrchief/7SV5K/

    This will solve your style issue. However, for button click to happen, you need attach a click handler for the li too.

    0 讨论(0)
提交回复
热议问题