0

I would like to mark the links the already read with a hook. Unread links should not display the hook. The rule is the visited link, and can differ only in color.

Would it be the fine to put the hook of the unread link transparent?
Or is there a better solution?

a.readed {color: rgba(0, 255, 0, 1)}
a.readed:visited {color: rgba(0, 255, 0, 0)}

<a href=""> goto</a><a href="" class="readed"> ✓</a>
Lovntola
  • 1,409
  • 10
  • 31

2 Answers2

1

Instead of adding additional link, just put it as CSS content of :after/:before

a:after {
  content: '✓';
  display: inline;
}
<a>Some link</a>
Justinas
  • 41,402
  • 5
  • 66
  • 96
  • The Hook should only displayed if the link are readed. The link himself should be allways visible. – Lovntola Feb 23 '17 at 08:26
  • a.visted:after { content: '✓'; display: inline; } coud work and Looks smarter. I will tried. – Lovntola Feb 23 '17 at 09:24
  • oh it must a:visited:after but ist wrong how can i write that both together works? – Lovntola Feb 23 '17 at 09:27
  • 1
    i found: http://stackoverflow.com/questions/12342516/combine-avisited-with-aafter-or-chaining-pseudo-classes-with-pseudo-elements – Lovntola Feb 23 '17 at 09:28
1

I would do something like change the color of the link to see what already was clicked.

a {
  color: blue;
}

a[tabindex]:focus:after {
 color: red;
 outline: none;
 content: 'insert hook here';
 display: inline;

}
<a href="#" tabindex="1">Test</a>

But your way is also good so if it works it doesn't really matter I guess.

EDIT:

didnt answer your question. so i tried some things this is the closest i got to displaying the hook only problem is after u click out range it hides again so fiddle arround with this.

B. Dionys
  • 916
  • 7
  • 34
  • You are right it is not a 100% solution. But it is only a "nice to have" and not importend for a process to display the marked hook. Like a Cookie solution are to much. Thx – Lovntola Feb 23 '17 at 09:06
  • No problem just do as you feel how it has to be done. it can be done in multiple ways. – B. Dionys Feb 23 '17 at 09:08