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 CSS Basics (2014) Understanding Values and Units Text Styles

Links decoration

Hey !

Why do the links have no decoration when they are :visited, when we set the text-decoration: none on not visited ( a:link)

4 Answers

Máté Végh
Máté Végh
25,607 Points

Hey,

"For privacy reasons, browsers strictly limit the styles you can apply using an element selected by this pseudo-class: only color, background-color, border-color, border-bottom-color, border-left-color, border-right-color, border-top-color, outline-color, column-rule-color, fill and stroke."

Full article here

So visited state always inherit it's value for text decoration from the unvisited state, and It can't be changed for privacy reasons.

Thank you !

Máté Végh
Máté Végh
25,607 Points

No problem! Note that if you apply any style for the :link (unvisited) state, it will also apply it to :visited, :hover, :focus and :active states as well. Except text color and border color to :visited state for some reason.

i think the a:link sets the text-decoration: none; for every link, even if its visited

im not sure though, someone correct me, if im wrong!

Kind regards // erdrag.

Máté Végh
Máté Végh
25,607 Points

That's right! I've declared the reason for it below.

Ok ! I wait for confirmation if someone is sure about it :)

Clifford Ng
Clifford Ng
5,090 Points

a:link sets the decoration for unvisited links. It might have something to do with another section of your code or there is another stylesheet provided that isn't yours which overrides a:visited.