Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Scott Raymond
Scott Raymond
6,542 Points

Cannot get a:visited styling to work. Ideas?

I cannot get visited link to show different color. All the others work fine. I have them in the proper order of link, visited, hover, then active. What am I doing wrong??

a {color: #00e; }

a:visited { color: #551a8b; }

a:hover { background-color: #06e; font-weight: bold; }

a:active { text-decoration: none; }

2 Answers

Greg Kaleka
Greg Kaleka
39,021 Points

Works fine for me. You've got something else going on. Got more code to post?

http://codepen.io/anon/pen/wGLEaM

Scott Raymond
Scott Raymond
6,542 Points

Maybe I am doing something wrong here

<header>
            <a href="restaurantSitev4.html">
                <h1 align="center">Atlanta Fish Market</h1>
            </a>
            <nav>
                <div id="navcontainer">
                    <ul id="navlist">
                        <li id="active"><a href="restaurantSitev4.html" id="current">Home</a></li>
                        <li><a href="menuv4.html">Menu</a></li>
                        <li><a href="contactUsv4.html">Contact Us</a></li>
                    </ul>
                </div>
            </nav>
        </header>

I'm super green at all this so I appreciate your help.

Greg Kaleka
Greg Kaleka
39,021 Points

You're not doing anything wrong - I updated the codepen above. It's all working perfectly. Why do you think it's not? The links won't actually work in the codepen, but if you right click and open the links in a new tab, you'll see they turn purple.

Note if you click on a link and then hit the back button, they won't show as visited until you refresh the page. I suspect that's what is happening :smile:

Scott Raymond
Scott Raymond
6,542 Points

Thanks for the help Greg. It's actually part of my pre-work assignments for my 12 wk coding boot camp and the instructor said the visited link was not working. So, the only reason I thought it wasn't right or wasn't working was because that's the feedback I got. But I thought it was correct too : )

Thanks for the input!

Cindy Lea
PLUS
Cindy Lea
Courses Plus Student 6,497 Points

Im assuming yourefreshed the browser after preview?