Navigation hyperlinks only work when mouse is on the text

后端 未结 2 726
死守一世寂寞
死守一世寂寞 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 {
        /* ... */
    }
    

提交回复
热议问题