li menu needs class of “selected”

前端 未结 7 1484
抹茶落季
抹茶落季 2021-01-15 18:20

when the user clicks on a menu tab i want it to remain selected with it a white button.

here is my attempt but its not working. if you click the home button it does

7条回答
  •  爱一瞬间的悲伤
    2021-01-15 18:27

    As far as I can tell from your CSS, you haven't defined any styles for the selected class.

    Assigning that class to your li isn't enough. You also need to style the class in the way you'd like.

    .selected{
     background-color:#fff;
    }
    

    (etc)

提交回复
热议问题