i'm pretty new to coding (just started a free weeks ago with html and css). For a news page i tried to implement "read on" links, similiar to this question here: on click hide this (button link) pure css
However i can't seem to make the link disappear after clicking it. I got this for my code so far (opening and closing works just fine):
.readmore {
display: none;
}
article[id*="n"]:target .readmore {
display: block;
}
article:target .used {
display: none;
}
<article>Text visible after you open the site.
<a href="#n2" class="used">Link that opens more text and should diappear after clicking</a>
<article id="n2">
<div class="readmore">more text
<a href="#back">Closing button</a>
</div>
</article>
</article>
I feel like i messed something up big time, but i really can't figure it out.