How to make buttons remain 'active' after they're clicked?

I'm currently using the following code for my menu items: HTML
  • About Us
  • Services
  • Contact Us
  • CSS #About {background-image: url(../Buttons/About.png); width: 87px;} #Services {background-image: url(../Buttons/Services.png); width: 112px;} #Contact {background-image: url(../Buttons/Contact.png); width: 117px;} a.button {height: 20px; display: inline-block; background-repeat: no-repeat} a.button:hover {background-position: 0 -20px;} a.button:active {background-position: 0 -40px;} I need to get the buttons to remain in the 'active' state after they're clicked and the page loads/refreshes etc. If the solution requires javascript, please bear in mind that I'm a rank amateur so I'll need any explanations in layman's terms (preferably with examples).
    I don't think this question deserve -1.

    以上就是How to make buttons remain 'active' after they're clicked?的详细内容,更多请关注web前端其它相关文章!

    赞(0) 打赏
    未经允许不得转载:web前端首页 » JavaScript 答疑

    评论 抢沙发

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址

    前端开发相关广告投放 更专业 更精准