Explaining The Basics Of A Show/Hide Implementation Of The Css :Target
I institute the code on StackOverflow for a uncomplicated CSS based hide/show scenario , it is an incredibly curt slice of code, exactly for the uninitiated it is hard to sympathise at showtime what is truly going on. So what I did showtime is to intermission downward the CSS into what happens at page charge fourth dimension as well as what happens at the indicate at which a target is linked to: /* happens on charge */ .answer, #show { display: none; } /* happens when demo is clicked */ #hide:target { display: none; } #hide:target + #show, #hide:target .answer { display: inline; } To explain: At charge fourth dimension whatever chemical component division where the shape is answer or the id is show is laid upwardly non to display. When a target amongst an id of hide is "targeted", i.e. from a link amongst <a href="#hide">[Text]</a> , then: the content amongst the hide id volition non display. any chemical component divi...