attila2452 Posted January 15, 2012 Share Posted January 15, 2012 Here is my HTML Navigation menu: <div id="navigation" > <ul> <li><a href="/">Home</a> <li><a href="services/">Services</a> <li><a href="portfolio/">Portfolio</a> <li><a href="about/">About</a> <li><a href="support/">Support</a> <li><a href="contact/">Contact</a> </ul></div><!-- navigation --> and my navigation CSS #navigation{ height: 65px; position:relative; top:30px; background: url("images/nav-bg.jpg") repeat-x top left; border-radius: 4px 4px 0px 0px; box-shadow: 0px -5px 5px #cb8400;}#navigation ul {list-style: none;}#navigation ul li{float: left;}#navigation ul li a{ color: #999999; padding: 0px 52px; font-family: Cambria, Georgia, serif; font-size:16px; font-weight:100; display: block; height: 60px; line-height: 60px; text-decoration:none;}#navigation ul li a:hover{color:#505050;text-shadow:0px -3px 1px #CCC;} And my website: http://hajzer.info/ how do i make the nav highlight the current page with PHP? Link to comment Share on other sites More sharing options...
dsonesuk Posted January 16, 2012 Share Posted January 16, 2012 You have to dynamically produce the menu using php, then you can compare with current url address, and then apply active class or id to have it highlighted in some way. IF a simply menu with no submenus you should just think about storing addresses in a array. Link to comment Share on other sites More sharing options...
attila2452 Posted January 16, 2012 Author Share Posted January 16, 2012 I like how its forcing me to learn how to do it . I appreciate it you not just giving me the script anymore. (for php) please dear god don't do the same for jQuery! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.