且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用CSS更改当前页面的链接颜色

更新时间:2023-01-28 13:31:02

a:active : when you click on the link and hold it (active!).
a:visited : when the link has already been visited.

If you want the link corresponding to the current page to be highlighted, you can define some specific style to the link -

.currentLink {
   color: #640200;
   background-color: #000000;
}

Add this new class only to the corresponding li (link), either on server-side or on client-side (using JavaScript).

相关阅读

技术问答最新文章