lew2937 Posted November 19, 2007 Share Posted November 19, 2007 I've added a:hover and a:active to my pages. The a:hover (listed first in the CSS) is working just fine, but a:active has no such luck. Any thoughts? i haven't used a:active before, so I might not have applied it correctly.Thanks for any suggestions!http://www.ivyla.com/contact.htmllew Link to comment Share on other sites More sharing options...
Ingolme Posted November 19, 2007 Share Posted November 19, 2007 a:active seems to be working ok for me on your site. And you're written it correctly. Maybe you don't understand the active state: active is when the mouse is down on the link.Also, you've applied the same color to the hover link as the active one, so you wouldn't notice the difference. Link to comment Share on other sites More sharing options...
lew2937 Posted November 20, 2007 Author Share Posted November 20, 2007 Oh. I guess you're right. I didn't understand. How can I get that particular navigation item to stay highlighted if you are on that page?Thanks,lew Link to comment Share on other sites More sharing options...
Ingolme Posted November 20, 2007 Share Posted November 20, 2007 Well, I guess javascript can do it. function init() { a = document.getElementsByTagName("a"); for(i=0;i<a.length;i++) { if(location.href.indexOf(a[i].href) != -1) { a[i].style.color = "white"; } }}window.onload = init; Link to comment Share on other sites More sharing options...
lew2937 Posted November 20, 2007 Author Share Posted November 20, 2007 okay. i'll try that. Does that go in the actual page though or the CSS? Sorry, I'm sort of new to all of this...obviously Link to comment Share on other sites More sharing options...
Ingolme Posted November 20, 2007 Share Posted November 20, 2007 Just put it between <script type="text/javascript"> and </script> and put it in the <head> of the document. Link to comment Share on other sites More sharing options...
lew2937 Posted November 20, 2007 Author Share Posted November 20, 2007 Great! Thanks. That worked. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.