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 trialEduardo Ramirez
1,553 PointsWhy is the text-decoration not applying to my visited pseudo selector.
Why doesn't my "text-decoration-line: line-through;" appear on my visited pseudo selector even if the other declarations do get applied?
/* Create visited and hover styles for all links inside 'main' */
main a:visited { color: rgb(155,140,178); text-decoration-line: line-through; }
3 Answers
Eric Perozich
Front End Web Development Techdegree Graduate 23,536 Pointsapparently there was an exploit in css that allowed people to use the :visited {text-decoration: ; } syntax to see a user's web history. to close this exploit browsers had to make the :visited{text-decoration: ;} syntax invalid/incompatible, so the two can no longer function in conjunction, all else seems to be fine, such as: background: ; color: ; text-size: ; etc.. but you cannot use the text-decoration in conjunction with the :visited pseudo-class anymore.
this link shows the list of valid syntax that uses the :visited pseudo-class.
credit to Brian Jensen - FEWD Student Success Specialist for providing the above link https://treehouse-fewd-102.slack.com/team/UNXTK1C9W
Jack Spangenberg
643 Pointstext-decoration
is the correct class.
Example:
text-decoration: none;
Eduardo Ramirez
1,553 PointsI've modified it and it still doesn't apply the change. I want there to be a line-through each link that has been visited. It does apply the color though.
Espen Gunstensen
1,574 PointsI have the same issue as yourself. The color works, but not the text-decoration. I did the same suggestions as the suggestions above.
Ezra Siton
12,644 PointsEzra Siton
12,644 PointsWrong syntax. This is the corrected value
text-decoration: line-through;
https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration