Revisiting :Visited(joelcalifa.com)

almost 7 years ago from Joel Califa, Senior Product Designer at GitHub

  • Ivan VásquezIvan Vásquez, almost 7 years ago

    Awesome. I would've guessed you could make a simpler implementation just by using an :after pseudo-element, kinda like this:

    a:visited::after { content: ' Seen'; //... s'more styles here }

    It turns out you can't! However, using ::after with other pseudo-classes such as :hover does work. Here's an example.

    Can anyone explain why that is? What's special about visited that doesn't let me use pseudo-elements?

    0 points
    • Joel CalifaJoel Califa, almost 7 years ago

      Hey Ivan, glad you enjoyed this :) The reason :visited is special is because of the security implications which I highlighted around mid-way through the article. It's a huge bummer but at the end of the day it's good for everyone.

      2 points