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 trialgyatmnucla
7,618 PointsLinks 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
25,607 PointsHey,
"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."
So visited state always inherit it's value for text decoration from the unvisited state, and It can't be changed for privacy reasons.
erdragerdragsson
Courses Plus Student 5,887 Pointsi 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
25,607 PointsThat's right! I've declared the reason for it below.
gyatmnucla
7,618 PointsOk ! I wait for confirmation if someone is sure about it :)
Clifford Ng
5,090 Pointsa: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.
gyatmnucla
7,618 Pointsgyatmnucla
7,618 PointsThank you !
Máté Végh
25,607 PointsMáté Végh
25,607 PointsNo 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.