I am new to coding (just started a week ago with html and css). On the news page, I tried to implement βreadβ links similar to this question here: on the button hide this (button link) pure css
However, I cannot make the link disappear after clicking on 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>
Run codeHide resultIt seems to me that I ruined something, but I really can not understand.
Mjyrn source
share