Some time ago I was helped by some of you to realize a simple css code to hide/show div with a given class.
And in my website that code works (you can see at this url).
But today, trying to apply it to a new situation (my local life timeline webpage) I should have omitted something.
The barebone-code is the following
<style>
.destination {
position: fixed;
} /* stop jump */
.my-toggle:hover,
.my-toggle:focus {
background: red;
color: #fff;
}
#classa:target ~ #list .eee,
#classa:target ~ #list .bbb,
#classa:target ~ #list .ccc,
#classa:target ~ #list .ddd,
#classb:target ~ #list .ddd,
#classb:target ~ #list .eee,
#classb:target ~ #list .aaa,
#classb:target ~ #list .ccc,
#classc:target ~ #list .aaa,
#classc:target ~ #list .ddd,
#classc:target ~ #list .eee,
#classc:target ~ #list .bbb,
#classd:target ~ #list .aaa,
#classd:target ~ #list .eee,
#classd:target ~ #list .ccc,
#classd:target ~ #list .bbb,
#classe:target ~ #list .aaa,
#classe:target ~ #list .ddd,
#classe:target ~ #list .ccc,
#classe:target ~ #list .bbb
{
display: none;
}
</style>
<title>highlight only some divs</title>
</head>
<body>
<h1>some title</h1>
<p>Show only <a class="my-toggle aaa" href="#classa">aaa</a> | <a class="my-toggle bbb" href="#classb">bbb</a> | <a class="my-toggle ccc" href="#classc">ccc</a> | <a class="my-toggle ddd" href="#classd">ddd</a> | <a class="my-toggle eee" href="#classe">eee</a> | Show <a class="my-toggle" href="#classx">all</a>.</p>
<div class="destination" id="classa"></div>
<div class="destination" id="classb"></div>
<div class="destination" id="classc"></div>
<div class="destination" id="classd"></div>
<div class="destination" id="classe"></div>
<div class="destination" id="classx"></div>
<div class="aaa">
some aaa text here
</div>
<div class="aaa">
some aaa text here
</div>
<div class="bbb">
some bbb text here
</div>
<div class="eee">
some eee text here
</div>
<div class="ccc">
some ccc text here
</div>
<div class="bbb">
some bbb text here
</div>
<div class="ddd">
some ddd text here
</div>
<div class="eee">
some eee text here
</div>
What I’m missing?