October 9, 200917 yr I am ripping my hair out because I can't find a way to style the link for the current page I am on, I am sure it's pretty straight forward. Here's my Nav css: /* TOP NAV */ .Links { font-size: 13px; width: 100%; overflow: hidden; } .Links ul { float: left; width: 95%; height: 24px; margin: 38px 0px 0px 0px; padding-top: 77px; } .Links ul li { display: inline; text-align: right; } .Links ul li a { float: right; height: 24px; _height: 20px; font-weight: bold; color: #555555; text-decoration: none; margin: 0px; padding: 0px 12px 0px 12px; } .Links ul li a:visited { color: #555555; text-decoration: none; } .Links ul li a:hover { color: #9b0000; text-decoration: underline; } I want it so the current page I am viewing, the link text in the nav will turn #9b0000. Thank guys, I'm still learning.
October 9, 200917 yr is it a dynamic link or a html one? if its done via a cms, then change the code to add in the following, or if html site, add to each link of that page html <a class="select" href="#">Link text</a> css a.select:link { color:#9b0000; }
October 9, 200917 yr Author It's just a HTML link to my pages. index.html services.html contact.html etc... Thanks so much, but it didn't seem to work. I will where was I supposed to add that CSS?
October 9, 200917 yr Hi christian, you need to specify a separate class for your current links eg .LinksCurrent then place all of your styling for that state in that class. one tip is to set cursor:default; in the current link state as it keeps the link clickable (which is useful sometimes to refresh/reset etc) but removes the little hand cursor link prompt. A good PHP exercise is calling your main nav as an include and setting simple statements to do the work for you, I haven't gone into detail as you might not be using PHP, let me know if it would be useful and I'll elaborate Stevo
October 9, 200917 yr Author I really don't get this, it's driving me crazy. About 3 hours I've been trying and messing up.
October 10, 200917 yr Author DONE! I am a little slow, but I got through it. What worries me is I have to learn like ASP.NET and **** for uni and I can't even do basic CSS.
Create an account or sign in to comment