Home > Article > Web Front-end > Use CSS to mark the current channel on the navigation bar
This article mainly introduces the use of CSS to mark the current channel on the navigation bar. It has a certain reference value. Now I share it with you. Friends in need can refer to
Webpage Production Webjx Article Introduction : The technology of using CSS to mark the current channel on the navigation bar has been around for a long time. It has been introduced in many CSS books, but it is still often asked, so I wrote a simple example to explain it.
In fact, the principle is very simple:
1) According to different channels (columns), define ids for the body respectively. For example:
Home page:
<ul id="nav"> <li class="nav_home"><a href="index.html">首页</a></li> <li class="nav_blog"><a href="blog.html">Blog</a></li> <li class="nav_album"><a href="album.html">相册</a></li> </ul>
3) The current position is distinguished by different body ids:
#p_home .nav_home a, #p_blog .nav_blog a, #p_album .nav_album a { …… }
The above is the entire content of this article , I hope it will be helpful to everyone’s learning. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
Introduction to jQuery browser CSS3 close-up compatibility
The above is the detailed content of Use CSS to mark the current channel on the navigation bar. For more information, please follow other related articles on the PHP Chinese website!