y0tis Posted June 8, 2013 Share Posted June 8, 2013 I'm having a problem with active links, I just can't seem to get it too work. Does anyone have any thoughts on what I might be doing wrong? #nav {background-color: #336;height: 200px;width: 600px;margin-top: 30px;margin-right: auto;margin-bottom: 0px;margin-left: auto;padding-top: 30px;padding-right: 20px;padding-bottom: 30px;padding-left: 20px;}#nav ul {margin: 0px;padding: 0px;}#nav ul li {display: inline;margin: 10px;background-color: #5252A3;padding-top: 5px;padding-right: 20px;padding-bottom: 5px;padding-left: 20px;} #nav a:link {color: #CCC;text-decoration: none;font-family: Tahoma, Geneva, sans-serif;font-size: 24px;} #nav a:visited {font-family: Tahoma, Geneva, sans-serif;font-size: 24px;color: #CCC;}#nav a:hover, a:focus {color: #C03;}#nav a:active {color: #0FF;} <div id="nav"><h1>Page 1</h1><ul> <li><a href="page1.html">page 1</a></li> <li><a href="#">page 2</a></li> <li><a href="#">page 3</a></li></ul></div> Thanks in advance for your help! L. Link to comment Share on other sites More sharing options...
niche Posted June 8, 2013 Share Posted June 8, 2013 http://www.w3schools.com/cssref/sel_active.asp Link to comment Share on other sites More sharing options...
jeffman Posted June 8, 2013 Share Posted June 8, 2013 Works in my browser. As you debug this, are you refreshing the stylesheet as well as the HTML document? Link to comment Share on other sites More sharing options...
dsonesuk Posted June 8, 2013 Share Posted June 8, 2013 Depends on what you expect :active to do, its not for highlighting a link for the current page it refers to, its for highlighting the link as you press down with the cursor, and only lasts as long as you press down on the link before moving to the page you selected, although if you press down to select and keep the button pressed down and move away from link it does remain the :active state until it loses focus. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now